0

Hello and thank you for taking the time to help me solve my problem. I like to build all of my web projects using a simple MVC Framework I have created along my travels. I seem to be having a problem getting the .htaccess file to work correctly on specific servers.

For example...

If you go to:

http://thomsonbrothersindustries.com/northside/ and attempt to access a page (right now only "About Us" is functional - http://thomsonbrothersindustries.com/northside/about) but as you can see the "about" page just directs you to a 404 Error.

Now, if you go to: (the same site, but on a different server)

http://ericzdisposal.com/northside/

http://ericzdisposal.com/northside/about

everything works fine...

Here is the .HTACCESS file:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?rt=$1 [L,QSA]

My privileges are limited on the server that is currently not working and I'm still working on getting better access to domain tools, but in the meantime I'm just trying to get a better idea of the problem and hoping there might be an easy fix in my future.

3
  • 1
    make sure mod_rewrite is enabled in your apache config
    – wesside
    Oct 10, 2012 at 17:56
  • What OS/distribution are the servers on?
    – wesside
    Oct 10, 2012 at 18:02
  • 1
    Looks like Windows, but I'm not 100% positive. My client setup most of the hosting circa 1999 so I'm trying to gather all the information now. DNS is pointing to www.1and1.com
    – j3ffz
    Oct 10, 2012 at 18:13

2 Answers 2

0

In addition to what @bigman suggested, make sure that AllowOverride directive setting is not very restrictive for your website directory. For mod_rewrite to work in .htaccess, you need to set AllowOverride FileInfo, but for testing purposes, you can set AllowOverride All.

1
  • Also make sure nobody changed the AccessFileName setting, you could set AccessFileName .htaccess to make sure it's the default
    – ivy
    Oct 10, 2012 at 18:17
0

Looks like adding the directory into the .htaccess file did the trick!

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ **/northside/**index.php?rt=$1 [L,QSA]

I didn't realize this was important because on the other server it did not matter

Thanks all!

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.