Subdomain to url by Mod Rewrite

Discuss practical ways rearrange URLs using mod_rewrite.

Postby richardk » Tue Nov 04, 2008 10:34 am

Now when i write

test.domain.com

it redirect to url

www.domain.com

Does the browser's address bar change to domain.com?

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} test\.example\.com [NC]
RewriteRule ^$ /test.php [QSA,L]

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} test\.example\.com [NC]
RewriteRule ^(.+)$ /test.php?action=viewcategory&articlecategory=$1 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Previous

Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 8 guests

cron