pepsi599ml Posted November 29, 2008 Share Posted November 29, 2008 I'v been hosting multiple sites on one account with 3 different providers thru years, and I'v been always experiencing this problem since the very beginning - Pointer Domains. Here is the code from .htaccess. RewriteCond %{HTTP_HOST} domain1.com RewriteCond %{REQUEST_URI} !domain1.com/ RewriteRule ^(.*)$ domain1_com/$1 [L] And the problem is when I go to a sub-directory (http ://domain1.com/dir) without a / (slash) at the end of the URL, the URL will be automatically changed to http ://domain1.com/domain1_com/dir. So how could I get rid of the domain1_com from the URL? I'v searched all over the internet and couldn't found a way to solve it. Please help. Thanks. Quote Link to comment Share on other sites More sharing options...
corbin Posted November 29, 2008 Share Posted November 29, 2008 You're telling it to add the domain1_com lol RewriteRule ^(.*)$ domain1_com/$1 [L] You have a couple of things wrong with your rewrite stuff, by the way. The CondPattern is supposed to be a "perl compatible regular expression." (http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritecond) You can throw a = in there though. RewriteCond %{HTTP_HOST} =domain1.com RewriteCond %{REQUEST_URI} domain1\.com/ Quote Link to comment Share on other sites More sharing options...
pepsi599ml Posted November 29, 2008 Author Share Posted November 29, 2008 You're telling it to add the domain1_com lol I'm not good at this htaccess thing, but domain1_com is actually the root directory of that domain. RewriteRule ^(.*)$ domain1_com/$1 [L] <--- all requests to this domain go into that directory ... ... RewriteRule ^(.*)$ domain2_net/$1 [L] <--- all requests to this domain go into that directory ... ... RewriteRule ^(.*)$ domain3_org/$1 [L] <--- all requests to this domain go into that directory I don't what's wrong with my rewrite stuff, but that piece of code has always been working...except for the annoying url problem. And, I was just told that this is called 'trailing slash' problem, but he didn't suggest a solution. Quote Link to comment Share on other sites More sharing options...
pepsi599ml Posted November 29, 2008 Author Share Posted November 29, 2008 OK, I found this, Fixing the trailing slash problem Hope that works Quote Link to comment Share on other sites More sharing options...
corbin Posted November 29, 2008 Share Posted November 29, 2008 Sounds to me like you need to change your config. Why would a domain not point to it's own root? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.