View Single Post
Old 02-25-2010, 10:46 PM  
acctman
Confirmed User
 
Join Date: Oct 2003
Location: Atlanta
Posts: 2,840
htaccess mod_rewrite help needed.

Hi can someone help me with this rewrite below... Thanks in advance.

Currently all sub domains are rewrite User.cial.com -> www.cial.com/view/USER.html ... I want to change that removing the subdomain rewrite and have www.cial.com/User -> www.cial.com/view/USER.html

Code:
<IfModule mod_rewrite.c>
RewriteEngine On		
RewriteCond %{HTTP_HOST} ^(cial\.com)$ [NC] 
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$ 
RewriteCond %{HTTP_HOST} !^(www\.)?cial\.com$ [NC] 
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.cial\.com$ [NC] 
RewriteRule ^(.*)$ http://www.cial.com/view/%2.html [R=301,L]
RewriteCond %{REQUEST_URI} !^ads/
RewriteCond %{REQUEST_URI} !^shop/
RewriteCond %{REQUEST_URI} !^swf/
RewriteCond %{REQUEST_URI} !^js/
RewriteCond %{REQUEST_URI} !^mm/
RewriteCond %{REQUEST_URI} !^files/
RewriteCond %{REQUEST_FILENAME}  !-d
RewriteCond %{REQUEST_FILENAME}  !-f
RewriteRule ^(.*) index.php [L]
</IfModule>
acctman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote