Click to See Complete Forum and Search --> : Mod ReWrite Is Ignoring Rule, and Giving a 404 Error


lightnb
08-24-2008, 08:22 PM
PHP info lists mod rewrite as being an installed module. I am building this site on my own computer, with Ubuntu 8 and apache 2.

The server's host name is "swiftfish", and the application is being developed in the "Application" folder, in "/var/www/Application".

So when I access "http://swiftfish/Application/" locally, the file "/var/www/Application/index.php" loads.

Now, I'm trying to add a virtual folder, "products" that redirects back to the index file. My .htaccess file at "http://swiftfish/Application/.htaccess" reads:


Options +FollowSymlinks
RewriteEngine on
RewriteRule ^products/$ index.php?page=products


But, when I visit "http://swiftfish/Application/products/" in my browser, I get a 404 Error.

Why isn't it redirecting?

ibechane
08-24-2008, 09:01 PM
try putting a forward slash
RewriteRule ^products/$ /index.php?page=products

lightnb
08-26-2008, 01:05 AM
Nope, still getting a 404....

ibechane
08-26-2008, 01:10 AM
where does index.php exist in your file structure?

lightnb
09-01-2008, 03:32 AM
/var/www/Application/index.php

ibechane
09-01-2008, 11:50 AM
That means your document root (where your domain goes) is /var/www/, right?

If so, try naming index.php based on the document root, that is,

RewriteRule ^products/$ /Application/index.php?page=products