Mod re-write issue with "/" (slash)

Discuss practical ways rearrange URLs using mod_rewrite.

Mod re-write issue with "/" (slash)

Postby khalookhaloo » Thu May 07, 2009 4:05 am

Hi,

I'm new in mod rewrite, the thing is it's about 4-5 days that I'm looking everywhere for a solution but no luck :(

The thing is that my .htaccess is like this:

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^([a-zA-Z0-9_-]+).html$ choose-restaurant.php?name=$1

now it's working well, the generated URL is:

http://localhost/online-eat/american-food.html

but actually I want it to be like this:
http://localhost/online-eat/restaurants ... -food.html
or
http://localhost/online-eat/restaurants ... -food.html

the thing is if I change my rule to this:
RewriteRule ^restaurants/([a-zA-Z0-9_-]+).html$ choose-restaurant.php?name=$1

it won't work anymore, I mean it shows me the text + contents but all the images and css are gone!

but if I use "-" instead of "/" everything works just fine!

I even put this line:
RewriteRule ^.+(/css/.+)$ $1 [L]
RewriteRule ^.+(/images/.+)$ $1 [L]

still no chance.

I really appreciate any help in advanced.
khalookhaloo
 
Posts: 1
Joined: Thu May 07, 2009 3:57 am

Postby richardk » Thu May 07, 2009 1:53 pm

richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 24 guests

cron