Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite issue

mod rewrite issue

         

vanevan

10:26 pm on Nov 15, 2006 (gmt 0)

10+ Year Member



I use mod rewrite to rewrite url's passed to a description page (detail.php) with variables attached to clean them up and for SEO efforts.

Here is what I have running:

Options +FollowSymlinks
RewriteEngine on
RewriteBase /

RewriteRule ^detail/II(.*)/$ detail.php?II=$1 [NC,L]
RewriteRule ^detail/II(.*)$ detail.php?II=$1 [NC,L]

The issue is that it works correctly when fed from pages within a subdirectory (ie www.site.com/directory/page.php) but not with pages in the root directory (ie www.site.com/page.php). When fed from a page in the root directory I get a 404 error.

I assume it's a path issue or something with RewriteBase / but I can't figure it out. I am moving to a new server (where it's not working) but it works fine on the old server.

jdMorgan

3:10 pm on Nov 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Need a bit more information, since there's nothing obviously wrong with that code.

First, where is the .htaccess file with this code located?
Second, when you get the 404 error, what is shown in your server error log?

Jim