Helen Jones

301 Redirects Html Tp Php.

15 posts in this topic

I'm thinking of moving from a html based website to a php based website and this will obviously incur a name change to every existing page therein!.

A 301 age redirect is the answer. I know how to do a 301 page redirect so the question isnt "how" but rather more simple.

When I redirect lets say...page.html to page.php do I leave page.html on the server for any sort of reference for search engines, or should the donor page (page.html) be deleted once the 301 request is placed into the htaccess file

No guessing.

Edited for typo The title should of course read "to PHP" and not "tp Php"

Edited by Helen Jones

Share this post


Link to post
Share on other sites

I'm thinking of moving from a html based website to a php based website and this will obviously incur a name change to every existing page therein!.

A 301 age redirect is the answer. I know how to do a 301 page redirect so the question isnt "how" but rather more simple.

When I redirect lets say...page.html to page.php do I leave page.html on the server for any sort of reference for search engines, or should the donor page (page.html) be deleted once the 301 request is placed into the htaccess file

No guessing.

Edited for typo The title should of course read "to PHP" and not "tp Php"

Not totally sure, but I think the nurdle-grinder needs connecting to the sprocket-fettler via a ½in Whitworth left-hand-threaded grunnion.

I don't claim to be an expert though.

Share this post


Link to post
Share on other sites

Not totally sure, but I think the nurdle-grinder needs connecting to the sprocket-fettler via a ½in Whitworth left-hand-threaded grunnion.

I don't claim to be an expert though.

Fuckin' hell Barry you must be pissed or bored if you are posting **** like this

Share this post


Link to post
Share on other sites

When I redirect lets say...page.html to page.php do I leave page.html on the server for any sort of reference for search engines, or should the donor page (page.html) be deleted once the 301 request is placed into the htaccess file

Unfortunately I'm completely out of Whitworth left-hand-threaded grunnions, in any size, but if the opinion of a left-handed geek is worth anything, I think you can do away with the original .html versions once the 301 redirect is in place, as that will handle redirects from search engines as well - though I've not tried it, so I could be wrong.

Something like the following in your .htaccess I guess:

RedirectMatch 301 (.*)\.html$ http://www.yourwebaddress.com$1.php

assuming the new .php pages have the same names as the original .html ones, anyway.

Though I guess to many that the nurdle-grinder response may make more sense.

Share this post


Link to post
Share on other sites

I'm thinking of moving from a html based website to a php based website and this will obviously incur a name change to every existing page therein!.

You don't have to change the file extension for every page.

PHP is an extension to Web Servers, and a PHP enabled web-site will serve either/both types of page.

You can include php scripting in html pages, or tell the php interpreter to process .html pages as php pages.

A 301 age redirect is the answer. I know how to do a 301 page redirect so the question isnt "how" but rather more simple.

When I redirect lets say...page.html to page.php do I leave page.html on the server for any sort of reference for search engines, or should the donor page (page.html) be deleted once the 301 request is placed into the htaccess file

It doesn't really matter, it won't be used, but you could leave it in place as static page as fall back position.

However if you are going to start using URL rewriting, then there is no need for any extension to appear in the url.

It is considered good practice to hide the file extension and use cannonical urls.

e.g.

http://www.example.com/home => could be index.html or home.php

This keeps the web-site inteface consistent but allows changes under the bonnet.

Edited by WykeTyke

Share this post


Link to post
Share on other sites

Not totally sure, but I think the nurdle-grinder needs connecting to the sprocket-fettler via a ½in Whitworth left-hand-threaded grunnion.

I don't claim to be an expert though.

When I was at school I used to wonder what drove some of the teachers to throw bunches of keys , blackboard dusters and various other objects at some of the boys. Thank you for solving that decades long riddle.

Share this post


Link to post
Share on other sites

Unfortunately I'm completely out of Whitworth left-hand-threaded grunnions, in any size, but if the opinion of a left-handed geek is worth anything, I think you can do away with the original .html versions once the 301 redirect is in place, as that will handle redirects from search engines as well - though I've not tried it, so I could be wrong.

Something like the following in your .htaccess I guess:

RedirectMatch 301 (.*)\.html$ http://www.yourwebaddress.com$1.php

assuming the new .php pages have the same names as the original .html ones, anyway.

Though I guess to many that the nurdle-grinder response may make more sense.

Thank you . I know how but I'm keeping the same domain so its really only a case of simplfying it to ...........

redirect 301 /webpage1.html http://www.^%&((£*.co.uk/webpage2.html

Its the page thats been redirected I'm unclear about- although I suspect it has become no existant to the robots who no longer visit it as theyve been redirected by the 301. Ive deleted them anyway and the old search engine result is redirecting as should be. Bit of a gamble but seems to be paying off.

Share this post


Link to post
Share on other sites

You don't have to change the file extension for every page.

PHP is an extension to Web Servers, and a PHP enabled web-site will serve either/both types of page.

You can include php scripting in html pages, or tell the php interpreter to process .html pages as php pages.

It doesn't really matter, it won't be used, but you could leave it in place as static page as fall back position.

However if you are going to start using URL rewriting, then there is no need for any extension to appear in the url.

It is considered good practice to hide the file extension and use cannonical urls.

e.g.

http://www.example.com/home => could be index.html or home.php

This keeps the web-site inteface consistent but allows changes under the bonnet.

Thanks Tyke.

I'm replacing all my pages on my main site. As each page is re written in php I intent to redirect the old page -hopefully this keeps things ordered and managable. I can rewrite each page and take the time to make sure everything is OK individually page by page hopefully retaining all my page rank and 'link juice' I also know exactly what has gone on and what changes have been made.

The pages should look the same but be a lot more managable and with a lot more flexibility and more importantly a lot more SEO sensitive.

One of my concerns - apart from the sheer clutter leaving so many unsued html pages on my server mixed with my php files, is the problem of duplicate content and the search engine penalties duplication can incur

Anyway I appreciate you taking the time to reply.

Share this post


Link to post
Share on other sites

Thanks Tyke.

One of my concerns - apart from the sheer clutter leaving so many unsued html pages on my server mixed with my php files, is the problem of duplicate content and the search engine penalties duplication can incur

You wouldn't need to worry about the duplicate content if your old pages don't appear in links from your renewed site. The old pages will soon drop off the Google index but using 301 redirects is not a bad idea.

To check you should do a Google search on site:www.classyblonde.co.uk and this will show up all the pages that Google thinks you have.

You should also set up (free) Google Analytics and Google Webmaster Tools so that you know what visits you're getting, what search keywords you're being indexed and found on. If Google has any problems with your site then you will find out from these.

HS

Share this post


Link to post
Share on other sites

Its a very simple and painless process -

Just create a new file - .htaccess - in your website's root directory and insert the following -

RewriteEngine on

rewritecond %{http_host} ^yourfirstwebsitename.com [nc]

rewriterule ^(.*)$ yoursecondwebsitename.com/$1 [r=301,nc]

Share this post


Link to post
Share on other sites

One of my concerns - apart from the sheer clutter leaving so many unsued html pages on my server mixed with my php files, is the problem of duplicate content and the search engine penalties duplication can incur

The redirect will mean that search engines will only see the new page (i.e. where it's been redirected to).

Personally, I would delete the old pages just to keep things tidy.

(Actually, these days I'd just use a CMS like WordPress but hey. ;) )

B

Share this post


Link to post
Share on other sites

Actually, these days I'd just use a CMS like WordPress but hey. ;)

Very good advice. Easy to use freeware.

Share this post


Link to post
Share on other sites

Very good advice. Easy to use freeware.

The question was....."When I redirect lets say...page.html to page.php do I leave page.html on the server for any sort of reference for search engines, or should the donor page (page.html) be deleted once the 301 request is placed into the htaccess file"

but thank you for the WordPress tip. So good Ive been using it for years in one form or another! ;)

Share this post


Link to post
Share on other sites

The question was....."When I redirect lets say...page.html to page.php do I leave page.html on the server for any sort of reference for search engines, or should the donor page (page.html) be deleted once the 301 request is placed into the htaccess file"

but thank you for the WordPress tip. So good Ive been using it for years in one form or another! ;)

Which is why my comment about WordPress was in parenthesis. ;)

B

Share this post


Link to post
Share on other sites

Which is why my comment about WordPress was in parenthesis. ;)

B

Thanks. Appreciated.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now