Jump to content

domain search not working


Dillu

Recommended Posts

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?

Link to comment
Share on other sites

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 by tripler
Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated