djr33
03-01-2011, 07:56 PM
I switched to a host for several of my domains that requires a "main" domain.
I don't have access to anything in the server configuration that lets me change that.
What I want is to host multiple sites, and have none of them located in the root folder.
In other words, I want the root folder to contain (in addition to several configuration files) /mydomain1.com/, /mydomain2.com/, etc.
This works fine except for that main domain that is supposed to be located in the root.
In order to work around this, I'm using mod_rewrite via .htaccess.
Here's my .htaccess file:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ci-pro.com
RewriteCond %{REQUEST_URI} !^/ci-pro.com
RewriteRule ^(.*)$ ci-pro.com%{REQUEST_URI}
Here's the site:
http://ci-pro.com
Everything works well, except for one thing: the extra "ci-pro.com/" is appended to the URL when I visit a link. Load the page then click one of the links in the header-- it doubles the domain name (one for the domain, another for the subdirectory).
This is really annoying and I can't find any way around it or any information about this. I thought that mod_rewrite was supposed to be completely silent...
I don't have access to anything in the server configuration that lets me change that.
What I want is to host multiple sites, and have none of them located in the root folder.
In other words, I want the root folder to contain (in addition to several configuration files) /mydomain1.com/, /mydomain2.com/, etc.
This works fine except for that main domain that is supposed to be located in the root.
In order to work around this, I'm using mod_rewrite via .htaccess.
Here's my .htaccess file:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ci-pro.com
RewriteCond %{REQUEST_URI} !^/ci-pro.com
RewriteRule ^(.*)$ ci-pro.com%{REQUEST_URI}
Here's the site:
http://ci-pro.com
Everything works well, except for one thing: the extra "ci-pro.com/" is appended to the URL when I visit a link. Load the page then click one of the links in the header-- it doubles the domain name (one for the domain, another for the subdirectory).
This is really annoying and I can't find any way around it or any information about this. I thought that mod_rewrite was supposed to be completely silent...