Forum Moderators: phranque

Message Too Old, No Replies

Shortening URLS using mod_rewrite

from /index.php?c=dz to /dz

         

Jeremy_H

4:38 pm on May 13, 2006 (gmt 0)

10+ Year Member



Hello,

I have an index page that gets variables passed along from the URL.

example.com/folder/index.php?c=dz

Since its the index page I can shorten that to:

example.com/folder/?c=dz

I was told that I could use mod_rewrite to make it even shorter, to something like:

example.com/folder/dz

I've looked online for some information on mod_rewrite, and came up with a solution like this:

Options +FollowSymLinks
RewriteEngine on
RewriteRule /folder//(.*)/(.*)/$ /folder/?$1=$2

Would I add this to my .htaccess file? Does the script have any problems with it, or are their any caveats I should watch out for? Is this URL shorting idea even advisable?

Thanks

jdMorgan

12:07 am on May 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have a look in our Library [webmasterworld.com]. I believe you're looking for something like this [webmasterworld.com].

Jim