473,799 Members | 2,683 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using javascript to redirect visitors based on their search queries

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
2 1500
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
<en******@walla .com> wrote in message news:11******** **************@ g44g2000cwa.goo glegroups.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.ht m'},
{'kWord' : 'weeding', 'url' : 'gardening.htm' },
{'kWord' : 'planing', 'url' : 'carpentry.htm' } ];

Then (assuming document.referr er 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2108
by: Carter Smith | last post by:
http://www.icarusindie.com/wiki/index.php/Server-Side_Javascript_Check Sample source included This method requires that your pages are PHP enabled and you have mySQL. Although I suppose you could also use PHP sessions (not cookies as they're client editable). You could actually use any server side scripting language such as Perl or ASP and any database like MS SQL Server. I prefer PHP and MySQL.
6
1960
by: Penny | last post by:
Hi all, I've built a simple search <Form> on a web page that is intended to allow the user to search a record store database. There is a drop down box where the user can choose either 'Artist' or 'Title', next is a text box where they enter their 'Keyword' and next is the search button. For example the user may choose 'Artist', type 'Bob Dylan', click the search button and be presented with a page showing all the details of the Bob...
8
2534
by: Luciano A. Ferrer | last post by:
Hi! I was following the http://www.seomoz.org/articles/301-redirects.php article, trying to do that with one of my test sites I added this to the .htaccess file: RewriteEngine On RewriteCond %{HTTP_HOST} !^domain\.com.ar RewriteRule ^/(.*) http://domain.com.ar/$1
11
2220
by: Kent Feiler | last post by:
One thing I like about frames is that they're a good place to stow Javascript. Javascript that I'd like to be around while the visible content of the screen changes goes in the frame declaration HTML file. It never needs to be reloaded and JS variables can be updated there as the visible screens progress. But...if I want to be a good internet samaritan and not use frames, what's the best way to replace that function?
36
2189
by: Mark Rae | last post by:
Hi, Just had an interesting message from someone who was unable to view one of my sites because they have JavaScript turned off, and expecting me to re-write my site so that they could view it... I'm interested in hearing other people's opinions about this. I use JavaScript all the time, and can't really imagine ASP.NET development without it...
8
2855
by: Taras_96 | last post by:
Hi everyone, We' ve come to the conclusion that we wish the user to be directed to an error page if javascript is disabled <enter comment about how a webpage shouldn't rely on javascript here :) >. I've read quite a few posts on how to do this, but none meet my need (the two main suggestions was set a jsEnabled variable in a <scriptsection of the HTML and read it in PHP, and the other suggestion was by default loading the non js page,...
83
4239
by: liketofindoutwhy | last post by:
I am learning more and more Prototype and Script.aculo.us and got the Bungee book... and wonder if I should get some books on jQuery (jQuery in Action, and Learning jQuery) and start learning about it too? Once I saw a website comparing Prototype to Java and jQuery to Ruby... but now that I read more and more about Prototype, it is said that Prototype actually came from Ruby on Rails development and the creator of Prototype created it...
0
9689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10495
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10269
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10248
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.