Forum Moderators: phranque

Message Too Old, No Replies

Help to rewritting URL

how to use mod_rewritte

         

oscar78

10:45 am on Feb 16, 2005 (gmt 0)

10+ Year Member



Hello,

Can somebody help me to rewrite an URL?
I starting today to use regular expressions, but I have some problems.

I need to rewritte url as this:

- www.example.com/index.php?cnt=home
- www.example.com/index.php?cnt=services

to this:

- www.example.com/home
- www.example.com/services

Thank you!

̉scar

(sorry, my english is very elementary)

hakre

11:21 am on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



mod_rewrite is described indeep in the apache docs. there you find not only a detailed description how it works and a in depth discription for each config command, you find even multiple pages with practical solutions. visit [httpd.apache.org...] and check it out.

a solution for your quest can be but not must:

RewriteRule ^/index.php?cnt=(.*)$ /$1 [L]

there is no info wether you want to have this transparent or as a (static/temporary?) redirect nor what's intended.