...

View Full Version : .htaccess rewrite



blackcoder
04-06-2010, 09:52 AM
please help me here,i need immediate response
I like to rewrite this url:
www.hamroworld.com/anyvariable
to www.hamroworld.com/profile.php?profile=anyvariable

The anyvariable can be anything not only anyvariable.

For eg:if someone enters hamroworld.com/username ,she/he should get the content of hamroworld.com/profile.php?profile=username.:mad:

DJCMBear
04-06-2010, 12:23 PM
To do this just put this into your .htaccess file:



RewriteEngine on
RewriteRule ^([a-zA-Z0-9-_]+)$ /index.php?profile=$1


This will allow:
www.hamroworld.com/anyvariable (http://www.hamroworld.com/anyvariable) = www.hamroworld.com/profile.php?profile=anyvariable (http://www.hamroworld.com/profile.php?profile=anyvariable)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum