Forum Moderators: open

Message Too Old, No Replies

Javascript redirect & searchengines

How do i redirect to the index of current directory and do search engine

         

nigelt74

12:47 am on Oct 23, 2007 (gmt 0)

10+ Year Member



Hi all

Ok here are two versions the short version and the long version, the short version basically explains my questions, the long version answers the WHY I am asking question and mentions what I have done

The short version

Site has lots of old files in various directories on it that need redirecting, these old files contain a link to a javascript file, i am thinking of replacing the contents of this file with a javascript redirect


<!--
window.location = "http://www.mysite.com/"
//-->

however I have two problems with this
1) I have heard that search engines penalise this type of thing
2)I would prefer to redirect to the index of the directory the file is located

and that's it for the short version

The long version
(read the short version as well)
Site has 100s of thousands of pages in various directories, every time pages have been added/replaced the old pages have been left on the site rather than being removed (all links to the pages have supposedly been removed), consequently there are a lot of old pages up there, and although they shouldn't be linked customers seem to be able to find them and are able to purchase from them at old prices!

I am not allowed to delete these pages, but I have been writing redirects (.htaccess 301) for the most recently replaced pages.

The issue is the sheer number of redirects that would be required (my estimated finishing date is mid 2008, the boss wants it done in a fortnight)

JAB Creations

5:16 am on Oct 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could probably do a sort of match all method with Apache to the directories that you need to redirect. Try posting your question in the Apache forum. There should be no reason to be making thousands of redirects!

- John

nigelt74

6:08 am on Oct 23, 2007 (gmt 0)

10+ Year Member



I am doing redirects in apache that are matching lots of files, but the issue is they can't get everything
for instance one folder has 4300 html files in it and there were no real file naming conventions, although where there were I am doing matches to eliminate a good portion of the old pages there are 2-300 folders and sub-folders that i have seen so far and I am only on one section of the site

The main difference between the old files and the new ones is that about 6 months ago the company changed the site livery and with that the name of the javascript file that it had used for the previous 3 years

I can't sort by file name because what is a current filename in one directory is an old filename in another directory, which also means i can't sort by directory as their are hundreds of directories which have anywhere from 2 - 4000 files in each of them,

The main reason i have come to the javascript side is that i have exhausted what i can do on the apache side, i would estimate i am catching 70% of the old files, but the problem now is that the majority of rules I am writing now are only removing 1 or 2 files at most, there are no more big catch-all rules that i can write

I was hoping that javascript could remove the other 30% in one fell swoop, but then i read that search engines may not like it

nigelt74

12:10 am on Oct 24, 2007 (gmt 0)

10+ Year Member



Ok

If doing a javascript redirect is not a good idea am i able to include a robot noindex type thing in the external javascript file that would stop those pages being indexed?