It works but only redirects to root...why?

New to mod_rewrite? This is a good place to start.

It works but only redirects to root...why?

Postby raisinlove » Thu Aug 19, 2004 3:00 am

Hi, I'm using the following:

Options +FollowSymlinks
RewriteEngine on
Rewritebase /
RewriteRule ^([0-9a-zA-Z]+)\.html$ /index.php?p=$1.html [R]

What it's doing:

http://www.foo.com/foo/foo.html
http://www.foo.com/index.php?p=foo.html

What I really want it to do:

http://www.foo.com/foo/foo.html
http://www.foo.com/foo/index.php?p=foo.html

Obviously something is missing in my rules, which omits the current directory. Can anyone point it out to me?

thanks
raisinlove
 
Posts: 8
Joined: Thu Aug 19, 2004 2:54 am

Postby seomike » Thu Aug 19, 2004 4:22 pm

RewriteRule ^.*/([0-9a-zA-Z]+)\.html$ /index.php?p=$1.html [R]
seomike
 
Posts: 331
Joined: Thu May 06, 2004 7:36 pm
Location: Dallas

Postby raisinlove » Fri Aug 20, 2004 12:50 am

Great! Thanks :)
raisinlove
 
Posts: 8
Joined: Thu Aug 19, 2004 2:54 am

Postby seomike » Mon Aug 23, 2004 7:25 am

no problem :)
seomike
 
Posts: 331
Joined: Thu May 06, 2004 7:36 pm
Location: Dallas


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 8 guests

cron