Is this possible if 'www.directory.com' domain name is pointing to the www.domain.com servers?
www.domain.com/directory => www.directory.com
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^(www\.)?(directory)\.com$ [NC]
RewriteRule ^(.*)$ /%2/$1 [QSA,L]
#RewriteEngine On
#RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
#RewriteRule !^folder(/.*)?$ /folder%{REQUEST_URI} [QSA,L]
Options +FollowSymLinks
RewriteEngine On
# Force www.
RewriteCond %{HTTP_HOST} ^(decisionsin\.com)$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^(www\.)?decisionsin\.com$ [NC]
# Ignore real files (in your document root).
RewriteCond %{SCRIPT_FILENAME} !-f
# Ignore real directories (in your document root).
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ /inspace/$1 [QSA,L]
richardk wrote:This should do it
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
# Force www.
RewriteCond %{HTTP_HOST} ^(domain\.com)$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
# Ignore real files (in your document root).
RewriteCond %{SCRIPT_FILENAME} !-f
# Ignore real directories (in your document root).
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ /folder/$1 [QSA,L]
richardk wrote:Ah, replace ".*" in the last rule, with ".+".
# Force www.
RewriteCond %{HTTP_HOST} ^(domain\.com)$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
# Ignore real files (in your document root).
RewriteCond %{SCRIPT_FILENAME} !-f
# Ignore real directories (in your document root).
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.+)$ /folder/$1 [QSA,L]
domain wrote:richardk wrote:Ah, replace ".*" in the last rule, with ".+".
Thanks again for the quick reponse. Unfortunately, seems to be the same result. To make this easier I went ahead and left the code in the .htaccess file. The site is down but at least this way you can see what is going on. Check out http://www.domain.com and http://www.domain.com/folder. I can't leave the site down for too long, so if the site happens to work then I removed the code.
Here is the code I used:
- Code: Select all
# Force www.
RewriteCond %{HTTP_HOST} ^(domain\.com)$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
# Ignore real files (in your document root).
RewriteCond %{SCRIPT_FILENAME} !-f
# Ignore real directories (in your document root).
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.+)$ /folder/$1 [QSA,L]
Options +FollowSymLinks
RewriteEngine On
# Force www.
RewriteCond %{HTTP_HOST} ^(domain\.com)$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
# Ignore real files (in your document root).
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule !^folder(/.*)?$ /folder%{REQUEST_URI} [QSA,L]
# Ignore real directories (in your document root).
RewriteCond %{SCRIPT_FILENAME} !-d
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^folder(/(.*))?$ http://www.domain.com/$2 [R=301,L]
RewriteCond %{HTTP_HOST} ^(domain\.com)$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/$ [OR]
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ /folder/$1 [QSA,L]
Users browsing this forum: No registered users and 109 guests