Using javascript to redirect visitors based on their search queries

E

enterthe

Hey,

I have lots of visitors to my site from search engines, but they don't
always get sent to the right page.

So... based on the search query of the refering search page (e.g.
google or yahoo) how can I redirect the user to another page.

For example, if they searched for "browsers" and got to my website then
I'd like to redirect them to my page about web browsers.

Thanks,

Anon.
 
D

dx27s

Hey,

I have lots of visitors to my site from search engines, but they don't
always get sent to the right page.

So... based on the search query of the refering search page (e.g.
google or yahoo) how can I redirect the user to another page.

For example, if they searched for "browsers" and got to my website then
I'd like to redirect them to my page about web browsers.

Thanks,

Anon.

The page that a search engine sees should be the same one your human
visitors see. Using redirects as you suggest is usually not recommended,
and might even cause your site to be removed from some search engines
because it violates their policy about "doorway" pages.
 
S

Stephen Chalmers

Hey,

I have lots of visitors to my site from search engines, but they don't
always get sent to the right page.

So... based on the search query of the refering search page (e.g.
google or yahoo) how can I redirect the user to another page.

For example, if they searched for "browsers" and got to my website then
I'd like to redirect them to my page about web browsers.
You could have an array of objects each consisting of a search word/url pair:

var url_Lookup=[ {'kWord' : 'browsers', 'url' : 'browserpage.htm'},
{'kWord' : 'weeding', 'url' : 'gardening.htm'},
{'kWord' : 'planing', 'url' : 'carpentry.htm'} ];

Then (assuming document.referrer is available and contains a '?' ) loop through the array searching for word matches in
the remainder of the referrer string. If a match is found, jump to the associated url.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top