Dillu Posted March 8, 2012 Share Posted March 8, 2012 Dear Sir, I have create a form, in which person can search domain, that page goes toward domain registration search page. when i write http://www.dmain.com/search'>http://www.dmain.com/search its goes to /billing/cart.php?a=add&domain=register its works fine BUT if i write http://domain.com (exclude http://www.) then its goes to /billing/cart.php?a=add&domain=register and do not search any domain, only loading domain search , but dont show the result.. its only working for those customer who comes via www. not http://domain.com. how to solve this issue? 0 Quote Link to comment Share on other sites More sharing options...
tripler Posted March 8, 2012 Share Posted March 8, 2012 (edited) You have a larger issue of duplicate content. You have a canonical naming issue because http://www.domain and domain.com, are often treated as two separate pages. you need to either choose 1 or the other and provide 301 redirects. So if you want http://www.domain.com you need to RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.DOMAINs\.TLD$ RewriteRule (.*) DOMAIN.TLD/$1 [R=301,L] if oyu want to have your site be domain.com Then you 301 www. RewriteEngine On RewriteCond %{HTTP_HOST} !^DOMAIN\.TLD$ RewriteRule (.*) DOMAIN.TLD/$1 [R=301,L] It is not good to have www. and non www. edit* also you will need to rewrite more rules in .htaccess if you have existing content and links so that when you fix the issue a bot or user does not get a error when trying to view... say a whmcs knowledge base article or something. Edited March 8, 2012 by tripler 0 Quote Link to comment Share on other sites More sharing options...
tripler Posted March 8, 2012 Share Posted March 8, 2012 I should add, for anyone who stumbles across this page that the same rules apply for /index. html/php Your internal links pointing to your homepage should just resolve to domain.com and not index.html/php or to only the index pages So if you have a inner page pointing to domain.com/index and you dont have any rules in place to 301 domain/index or http://www.domain/index'>http://www.domain/index thats a duplicate page. So either set a rule for anything to /index to 301 to domain.tld or http://www.domain.tld'>http://www.domain.tld vis versa To sum up Choose only one: domain.tld or http://www.domain.tld'>http://www.domain.tld domain.com domain.com/index - http://www.domain -- http://www.domain/index'>http://www.domain/index or visa v ex: domain.com 301 domain.tld/index 0 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.