www.domain.com/subdirectoy... -> domain.com/subdirectory

Using a single web hosting account to host multiple sites

www.domain.com/subdirectoy... -> domain.com/subdirectory

Postby brentley_11 » Tue Feb 27, 2007 9:48 am

Basically I have a .htaccess that sits in a subdirectory and I want it to remove any www in the URL if they access anything inside that subdirectory and beyond.

Everything I tried did this:

Code: Select all
http://www.domain.com/subdirectory/index.html --> http://domain.com/index.html


Any help is appreciated.
brentley_11
 
Posts: 1
Joined: Tue Feb 27, 2007 9:42 am

Postby richardk » Tue Feb 27, 2007 10:24 am

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^www\.(.+\..+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 113 guests

cron