SEO url again

Discuss practical ways rearrange URLs using mod_rewrite.

SEO url again

Postby xkuba » Mon Jun 09, 2008 1:33 am

Hi all,

I have some urls I use on my webpages:
www.example.com/index.php?page=offer&id=5&car=opel

and

www.example.com/index.php?action=delete

I need to convert it to:
www.exmaple.com/offer/5/opel

and

www.example.com/delete

So I need to create URL which consists of values after =

Please help me

Thanks a lot
xkuba
 
Posts: 1
Joined: Mon Jun 09, 2008 1:29 am

Postby richardk » Mon Jun 09, 2008 1:04 pm

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} -f [OR]
RewriteCond %{SCRIPT_FILENAME} -d
RewriteRule .* - [L]

RewriteRule ^([^/]+)/([0-9]+)/([^/]+)/?$ /index.php?page=$1&id=$2&car=$3 [QSA,L]
RewriteRule ^([^/]+)/?$                  /index.php?action=$1            [QSA,L]
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 86 guests

cron