By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,137 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

Using javascript to redirect visitors based on their search queries

P: n/a
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.

Oct 6 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
en******@walla.com wrote:
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.
Oct 6 '05 #2

P: n/a
<en******@walla.com> wrote in message news:11**********************@g44g2000cwa.googlegr oups.com...
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.

--
S.C.
Oct 6 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.