Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cross domain AJAX problem & Google listing

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Hi,

I have a problem , Google have my site indexed with preferred domain as "domainname.co.uk" , only because of the JS browser cross domain security, the AJAX won't run if you click the link from google, the AJAX is trying to communicate with "
I've used the webmaster tools to change preferred domain, but this could take a while and they say it's not fixed in stone either , whether they use what I set as preferred.

So how do I get round this?

Do I need to change the DNS somehow to do forwarding or how ever it is you do a proper re-direct, it's not something i've done before.

or is there a way of getting round this with JS? I'm unsure of the best action to take to fix this.

Thanks, 1DMF.


"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
are you using an apache server?

you can set up an htaccess modrewrite rule like so:


Code:
RewriteCond %{HTTP_HOST} ^domain\.co\.uk
RewriteRule ^(.*)$ [URL unfurl="true"]http://www\.domain\.co\.uk/$1[/URL] [R=permanent,L]

That will rewrite the non to www. and issue a 301 back to the requesting agent.

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
nope windows i'm afraid!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Could you not create a code snippet to include that the top of each page which would look at the request URI and do a 301 redirect if it wasn't the
My ASP is too rusty to do it without looking it up but it's pretty trivial I think. Just a couple of lines of code.


<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
nope not unless there is a way coding it with HTML or SSI as the site is only 5 pages and is SSI.

Can I change the URL with JS without doing a page change? if that makes sense.

or how do I get google to use the correct domain.

The other problem is if what ever I do 'breaks' the back button , then they will stop my AdWords, so I have to do something that is acceptable!

any suggestions



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Google has finaly set my prefered domain correctly, so all is well.

Won't make that mistake again in a hurry!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top