Please help me

Discuss practical ways rearrange URLs using mod_rewrite.

Please help me

Postby Guest » Fri Feb 04, 2005 10:37 am

Hallo,

I need Your help. I've implamented simple url to 80% of my website, now I got big problem with subcategories in my directory. The problem is I have url like this:

http://www.mysite.com/?req=cat&id=flash/films

and deeper

http://www.mysite.com/?req=cat&id=flash/films/swf
ect.

It wouldn't be a problem If I would have:
http://www.mysite.com/?req=cat&id=1/sid=2/ssid=3
But I dont have it.

So I need Your help how to write a rule in htaccess to convert this url:
http://www.mysite.com/?req=cat&id=flash/films

into

http://www.mysite.com/flash/films and
http://www.mysite.com/flash/films/swf

Thanks for any ideas!
Guest
 

Postby Caterham » Sun Feb 06, 2005 6:36 am

So I need Your help how to write a rule in htaccess to convert this url:
http://www.mysite.com/?req=cat&id=flash/films

into

http://www.mysite.com/flash/films and
http://www.mysite.com/flash/films/swf
wrong way: http://www.mysite.com/flash/films/swf to http://www.mysite.com/?req=cat&id=flash/films/swf
mod_rewrite cannot change your HTML source. you have to change all HTML links into your desired (static) form in your script manually.

To rewrite the incomming static request internally to its original dynaimcal form back:
Code: Select all
RewriteEngine On
RewriteRule ^(flash/?(.*))$ /?req=cat&id=$1 [L]
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm

Postby Guest » Wed Feb 09, 2005 1:22 pm

Thank You Caterham, that was what i needed!
Guest
 


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 32 guests

cron