Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-30-2006, 06:23 PM   PM User | #1
Nikolai459
New Coder

 
Join Date: Jul 2005
Location: Michigan
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Nikolai459 is an unknown quantity at this point
301 redirect

Hello All,

I recently redesign my works website. While doing this, I used php for every page. The old site was built on a html platform. I submitted everything to the search engines but all of my links are going to the old .html files.

I did some research and found that I could use a 301 redirect. I'm a little confused though because all I can find are php, asp, and asp net examples. These would work find but the pages that I need to redirect all have html extensions. Do I still use something like a php redirect script even if the extension is html?

Below is the code I can use for a php redirect...

PHP Code:
 Header"HTTP/1.1 301 Moved Permanently" );
Header"Location: http://www.new-url.com" ); 
If I was moving from a .php extension to another .php extension, it would make sense, but can I use something like the above code in a .html page?

Thanks in advance.
Nikolai459 is offline   Reply With Quote
Old 10-30-2006, 06:36 PM   PM User | #2
mark87
Senior Coder

 
Join Date: Dec 2004
Location: Essex, UK
Posts: 2,636
Thanks: 0
Thanked 0 Times in 0 Posts
mark87 is on a distinguished road
Best method would be to use .htaccess.

RewriteEngine on
Options +FollowSymlinks
RewriteRule old.html$ /new.php [R=301,L]
__________________
markaylward.co.uk
mark87 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:42 AM.


Advertisement
Log in to turn off these ads.