/raksts/1078/Tuv -->index.php?cat=raksts&id=1078

Discuss practical ways rearrange URLs using mod_rewrite.

/raksts/1078/Tuv -->index.php?cat=raksts&id=1078

Postby depp » Mon Mar 27, 2006 11:24 am

hi!

I need to convert address like this:
http://www.page.com/prece/1078/Tuvojas_Saules_aptumsums
http://www.page.com/prece/42/something_else
To that:
http://www.page.com/index.php?cat=prece&id=1078
http://www.page.com/index.php?cat=prece&id=42

Don't need last variable.

Already out of ideas :(

I tried:
RewriteRule ^prece/([0-9]+)/(.*)/? /index.php?cat=prece&id=$1 [L]
RewriteRule ^prece/([0-9]+)/? /index.php?cat=prece&id=$1 [L]
RewriteRule ^prece/([0-9]+) /index.php?cat=prece&id=$1 [L]
RewriteRule ^prece/([0-9]+)/(.*)/$ /index.php?cat=prece&id=$1 [L]
RewriteRule ^prece/([0-9]+)/(.*)/?$ /index.php?cat=prece&id=$1 [L]

Why this is not working?
depp
 
Posts: 1
Joined: Mon Mar 27, 2006 11:13 am

Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 28 guests

cron