0

Dear All,

This must be a very common problem, but yet nowhere on the internet wishes to display a working answer. I am in a sticky situation.

I have the following .htaccess file on my local webserver:

http://localhost/testsite/.htaccess

DirectoryIndex home.php?view=home

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ home.php?view=$1 [QSA,L]

ErrorDocument 404 /home.php?view=404

I now upload this file to http://domain.com/.htaccess and it simply will not work (404 errors). The URLs are meant to work like this:

http://domain.com/gallery
transforms server side to
http://domain.com/home.php?view=gallery

Please could someone suggest where my code may be going wrong and why?

Thanks so much!

1
Contributor
1
Reply
20
Views
3 Years
Discussion Span
Last Post by mattster
0

I have a solution:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /home.php?view=$1 [L]
</IfModule>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.