Re-direct web page? html to php

Forbiddenbiker

The Enforcer
Messages
11,048
Name
Adam
Edit My Images
Yes
Nothing photographic. but I really hope someone here can point me in the right direction guys ...

How do I swap my sites over, old for new?

I don't understand this subject very well but I've spent all morning looking at a .htacces file and a simple 301 redirect (or maybe not so simple)

So now I've just found out after several conversations with my hosting provider.. (fasthosts/Microsoft/php and other scipts) ...that they can NOT do a redirect of my /old.html pages to the /new.php pages

Even though that was my first question earlier this morning! :bang: ... "Oh no sorry no, we can do every other type of redirect but not html to php"

Well how daft is that!!


I have reasonable ranking with my old established html based site. Optiflow

And my new site is written in php (yes I know :bang:) ... Optiflow New

So the problem is; How should I go about replacing the old with the new and not lose web ranking and google index position whilst I do the swap..??

1. Should I run both sites together and simply edit all the links in the old site to go to the new..
I don't think googles gonna like that?

2.I read I can do a simple meta re-direct thing??? ... But that'll still mean a glitch transition between pages I believe?? And viewers who bookmark will still bookmark the old pages...
Is google okay with that one though?


Or what??

Any thoughts, ideas or suggestions please guys ...

pi**ed off and desperate :(
adam
 
simple easy answer is the meta redirect that will be so quick no will will even know you did it...

you cant do htaccess then ?? theres redirect or 404 type error commands that can send to your new page

dont run both together thats silly


try this

<META HTTP-EQUIV="refresh" CONTENT="1; URL=http://www.YOUR WEBSITE HERE">
 
But, and excuse me for getting this a** about face KIPAX... wont that mean that in the address bar, will be the old address and the new together.. and so if bookmarked by viewers they are still book marking the old address, not just the new...?

Will it also mean that google indexes the old and new address together ...which is all against the swapping of the actual new page addresses...as I'll still have the old address attached?

Kinda thing

I hope you understand me . :gag:
 
But, and excuse me for getting this a** about face KIPAX... wont that mean that in the address bar, will be the old address and the new together.. and so if bookmarked by viewers they are still book marking the old address, not just the new...?

Will it also mean that google indexes the old and new address together ...which is all against the swapping of the actual new page addresses...as I'll still have the old address attached?

Kinda thing

I hope you understand me . :gag:


it will force the browser to go to the new address so the new address will show in the address bar and the new address will be bookimarked


as for google.. so long as the old html exists it will stay in google... to alter that you need to delete the html and use htaccess but then you lose your current place in google i am guessing
 
No, not at all! daft hey. :shrug: ....I not sure I know what you mean by sending 404 error comands to the new page..

..could you brieftly expand on that one

Ta for you help. :)

go into notepad.. on a blank page put this

ErrorDocument 404 http://www.yoursite.com/index.php

save as .htaccess or howevr you spell it..oops and put in your main directory


then everyone who goes to your website and tries to look for a page that doesnt exist (like your now deleted index,htm) they will be directed to the index.php
 
with websites theres always more than one way to skin a cat... its a matter of finding the one your happiest with...
 
Okay great thanks, that sound like a good start.

On the .htaccess front, apparently (from the little I know) it needs to be backed by an apache-web something, which fasthost don't use, although they haven't actually said so. ... and there systems designed for re-directing everything else except htm pages to php pages...

I made this file (and other alternatives) and stuck it in my root on the .htaccess file but it seems thats not enough, lol.:gag:

PHP:
RewriteEngine on
RewriteBase /
RewriteRule (.*).htm$ /$1.php

redirect 301 /SitemapOPTIFLOW.html http://www.optiflowuk.com/sitemap.php


I'll try this idea thanks. :thumbs:


it will force the browser to go to the new address so the new address will show in the address bar and the new address will be bookimarked
 
that example would only redirect one page in your root called SitemapOPTIFLOW.html

dont know how windows servers work never been daft enough to try one..sorry :)

try the one line htaccess and see what happens.. it wont break anything :)
 
go into notepad.. on a blank page put this

ErrorDocument 404 http://www.yoursite.com/index.php

save as .htaccess or howevr you spell it..oops and put in your main directory


then everyone who goes to your website and tries to look for a page that doesnt exist (like your now deleted index,htm) they will be directed to the index.php

Doing this now .. :thumbs:
 
I will start by saying I know nothing about this but, if all else fails delete all your html site except for the first page (or pages that act as entrance pages), put a note on them about the new page address and also change all the links so they go to the new site. Hopefully Google will index the links thus increasing the ranking of your new site.

Now waiting to be shot down 'cos I have this all wrong :D

This worked for me when I changed addresses
 
if all else fails he will have to do that kerioak...... its not a nice way and google wont end up taking his index.php as main page... but if needs must. then it is another way yes:)
 
Oh hang on if index.html is deleted ...and the new index.php exsists .... then it'll go to the right index page anyway, being the index file....so why the .htaccess code?

?? or is there more to it?

I thought you knew that?

I thought the problem was people who have already bookmarked index.html getting an error page?
 
I will start by saying I know nothing about this but, if all else fails delete all your html site except for the first page (or pages that act as entrance pages), put a note on them about the new page address and also change all the links so they go to the new site. Hopefully Google will index the links thus increasing the ranking of your new site.

Now waiting to be shot down 'cos I have this all wrong :D

This worked for me when I changed addresses

Did you manage to keep ish your ranking and indexed position okay then?

I like the idea of simply clearing all the old indexed pages of info and placing a simple link to the new site in the middle of each one..

...google I imagine will see the point and index the new pages as the main pages, and over a period of time drop of the obvious link through page....

:shrug:



Finding the right combination is the key for me I think..
 
I thought you knew that?

I thought the problem was people who have already bookmarked index.html getting an error page?

Oh no sorry ... I thought that was your fix for re-direct, not your fix for stopping an error page..

I think. I am trying to keep up honest. :thumbs:

I should leave that in the blank .htaccess file then? as some one may very well have bokmarked the old htm index... cheers. :thumbs:
 
yes deleting htm and using php should work no problem so long as named index.php

i just presumed as you mentioned people already bookmarking that you where worried what would happen when they next visit your website and see it isnt there.. so htaccess would have pushed them to your new one without them realising :)

So long as we get there in the end it dont matter how :)
 
Definitely not claiming to be an expert here but I have redirected my old site to my new site as follows

On old site within your web design software select <body> of page(s) you want to redirect then add 'behaviour', 'go to url', fill in the new http address, upload.

Someone puts in the old address, they go to new one.

The old site stays indexed in Google and your new site displays.

I'm sure there are technical reasons why not to do this but it works for me. If I search for one of my optimized phrases I get my old site and the new one as it gathers pace with its SEO in Google's results.

Hope this helps, please feel free to disregard this advice if its rubbish though ;)

Neil
 
yes deleting htm and using php should work no problem so long as named index.php

i just presumed as you mentioned people already bookmarking that you where worried what would happen when they next visit your website and see it isnt there.. so htaccess would have pushed them to your new one without them realising :)

So long as we get there in the end it dont matter how :)


Ah yeah, good presumtion, nice one :thumbs:

I was thinking more along the lines of googles indexed pages and address spread all ove the palce allready.. I don't want to lose their depth, spread and position on the www in general kind thing.

About that code: ... Can I add any other path endings to that code and duplicate the action for all the other old bookmarked pages at all?
 
Definitely not claiming to be an expert here but I have redirected my old site to my new site as follows

On old site within your web design software select <body> of page(s) you want to redirect then add 'behaviour', 'go to url', fill in the new http address, upload.

Someone puts in the old address, they go to new one.

The old site stays indexed in Google and your new site displays.

I'm sure there are technical reasons why not to do this but it works for me. If I search for one of my optimized phrases I get my old site and the new one as it gathers pace with its SEO in Google's results.

Hope this helps, please feel free to disregard this advice if its rubbish though ;)

Neil

I think it helps Neil cheers, always good to get other ideas ... Edit: I've just tried that, my software didn't allow it... did think it would...I'll take a look at the code your site generates...


I 'll look into exactly what my software writes, good idea, thanks for that.:)
 
OK I am going to use the 301 re-direct htaccess
Code:
Options

+FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.adlington.info/$1 [R=301,L]

I'd like to be able to exclude a sub-directory from the redirect, but can't find the info on how to do this. Could one of you nice people give me a clue.
 
Fasthosts are bunch of useless *abusive swear words here*

.htaccess does not work with them, even on their apache servers, my advice is to change hosts.

.htaccess does not work on windoze servers.

Once you find a decent host with apache servers that can support custom scripts and htaccess, then you can use htaccess 301 redirects to their full and very useful effect.

Google does work very quick these days, however, if you dont want to lose your page rank, bookmarked visitors and links from around the internet, then a 301 redirect is the only way to do it.

Whiteflyer -
Before the RewriteRule, put this

RewriteCond %{REQUEST_URI** !^/example/

With example been the name of the directory.
 
Right I've now re-directed most of the sites pages by placing re-directs straight onto the old cleared webpages...

.... Seems to be my best all round answer, the only glitch in mp plan, quite a big glitch ....

It seems that the 404 code I put in the .htaccess file isn't working at all ...

Like if I try and find the address of my old index.html page I get a 'cannot found' not a 404 re-direct ... help??

This link ...
www.optiflowuk.com/index.html

I really need to get this re-directing too ...anyone???

:help:
 
Google does work very quick these days, however, if you dont want to lose your page rank, bookmarked visitors and links from around the internet, then a 301 redirect is the only way to do it.

How long do you think .... ?

I've made my changes now ... I could change it all back but my other non micro provider is half way accross the world not answering his calls...

...its done now, I suppose ...any idea about how I can get my old index.html page redirected? :) ... I cant leave it up with a re-direct being a index page .. so ...any ideas?
 
How long do you think .... ?

how long is a piece of string? Google is very secretive in some areas. Depends when they next crawl your site.

:)

I've made my changes now ... I could change it all back but my other non micro provider is half way accross the world not answering his calls...

...its done now, I suppose ...any idea about how I can get my old index.html page redirected? :) ... I cant leave it up with a re-direct being a index page .. so ...any ideas?

Theres only the good old fashioned meta redirect thats been mentioned before, but as they've been abused in the past for spam techniques, its not good to use it.
 
That's excellent.

Now can I just repeat that line for multiple directory's, or would I be better just using

Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html

for the directory's I DO want to move

If you stick that line i mentioned in the htaccess thats in the root folder, it will effect every sub folder, apart from the one you dont want redirecting, which what that extra line does.

But that redirect line is files, not directories...if you want redirect each html file to a new one, you going to have to write each page down, unless the new pages are on another domain, in which case you do url redirect.

does that make sense?

:)
 
how long is a piece of string? Google is very secretive in some areas. Depends when they next crawl your site.

:)



Theres only the good old fashioned meta redirect thats been mentioned before, but as they've been abused in the past for spam techniques, its not good to use it.


:thumbs: I've just asked them to re-crawl , they usually do in a day or seven ish I'm thinking.


That old fashioned redirect is what I'm using now right

Like this one

PHP:
<meta http-equiv="refresh" content="1;url=http://www.optiflowuk.com/contact.php">

... I cant have two index files in my root though? can I? so how, I'm confused.

....On the spamming front; Are there modifications I can do to improve its resilience to spammers at all ...and on that note, how long should one leave up redirects ... a year or something?


Cheers for you help. :)
 
If you stick that line i mentioned in the htaccess thats in the root folder, it will effect every sub folder, apart from the one you dont want redirecting, which what that extra line does.

But that redirect line is files, not directories...if you want redirect each html file to a new one, you going to have to write each page down, unless the new pages are on another domain, in which case you do url redirect.

does that make sense?

:)

Yes it makes sense, but there are several directories I do not want to re-direct, so can I put

RewriteCond %{REQUEST_URI** !^/example1/
RewriteCond %{REQUEST_URI** !^/example2/
RewriteCond %{REQUEST_URI** !^/example3/

Cheers
 
woah..so many questions :p

Forbiddenbiker -
2 indexes, yes you can, but only one will be your main page. Whatever settings you have on your site will determine which one is the main index like www.example.com could be index.php, but not index.htm
how long to leave up redirects..upto you really..im not aware of any rules regarding that so..1 hour, 1 week, 1 year, 1 ice age..upto you.
the spammers redirect stuff, it was used in days of ye olde internete to fool search engines to ranking that site higher for irrelevant phrases and the like. I wouldnt worry too much to be honest if thats the only thing to do. Just dont leave them there for ice age after ice age.

whiteflyer - yeah, i believe that way would be good to prevent redirects of certain folders.

:)
 
I've sorted my site out now thanks, but as a note the multiple lines of RewriteCond %{REQUEST_URI** !^/example1/ would not work. The first line was OK but the rest were just ignored.
 
woah..so many questions :p

Forbiddenbiker -
2 indexes, yes you can, but only one will be your main page. Whatever settings you have on your site will determine which one is the main index like www.example.com could be index.php, but not index.htm
how long to leave up redirects..upto you really..im not aware of any rules regarding that so..1 hour, 1 week, 1 year, 1 ice age..upto you.
the spammers redirect stuff, it was used in days of ye olde internete to fool search engines to ranking that site higher for irrelevant phrases and the like. I wouldnt worry too much to be honest if thats the only thing to do. Just dont leave them there for ice age after ice age.

whiteflyer - yeah, i believe that way would be good to prevent redirects of certain folders.

:)

Thanks. :) :thumbs:
 
Back
Top