Redirect to another URL

Discuss practical ways rearrange URLs using mod_rewrite.

Redirect to another URL

Postby shobekhan » Tue Jul 08, 2008 6:12 am

How can I redirect URL for example

http://www.example.com/home to http://www.example.com/index.php?action=home without changing it on top address bar
shobekhan
 
Posts: 1
Joined: Tue Jul 08, 2008 6:10 am

Postby richardk » Wed Jul 09, 2008 1:55 pm

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

# If it's not a request for an existing file
RewriteCond %{SCRIPT_FILENAME} !-f
# and it's not a request for an existing directory
RewriteCond %{SCRIPT_FILENAME} !-d
# rewrite.
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 51 guests

cron