Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
How to 301 Redirect a HTML page?!
Old 08-17-2011, 12:24 AM How to 301 Redirect a HTML page?!
Experienced Talker

Posts: 32
Trades: 0
Ok I’ve been doing web design for quite some time but haven’t ever needed to do 301 redirect a site before…I have someone who took over a company and also changed the company name so the entire website and domain name has changed. I need to 301 redirect the old site to the new. I know I could just throw an ASP or PHP 301 redirect BUT the problem is that the files are HTML. Wouldn’t that defeat the purpose if I changed all the file names to .ASPX and then redirected them to the new site? All the new .ASPX pages would be seen as new (or worse duplicate) content form google! How in the world am I supposed to 301 redirect html pages? Thanks for any help guys Seriously.
jpf566 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-17-2011, 02:17 AM Re: How to 301 Redirect a HTML page?!
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
You can configure the server to parse .html files as PHP (or ASP) or you can use .htaccess to do the redirection (on an apache server).

.htaccess would probably be the easiest way since you can just create one rule to redirect every page:

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^old-site.com$
RewriteRule ^(.*)$ http://new-site.com/$1 [R=301]
The above should (didn't test it) redirect every request from your old site to the corresponding page on the new site. For example old-site.com/somepage.html will be redirected to new-site.com/somepage.html
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by NullPointer; 08-17-2011 at 02:19 AM..
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 08-17-2011, 08:27 AM Re: How to 301 Redirect a HTML page?!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Matt, ASP/ASPX pages do not run on Apache so a .htaccess solution is of no use at all.

The principle is correct though, you can make .htm(l) files run as ASP or ASP.net if you have access to the IIS MMC or via a control panel such as Plesk.

Also Search engines have for several years now treated the meta refresh element as a redirect header.
A meta refresh of 0 seconds is treated as a permamanent redirect (301) and one second upwards as a temporary redirect (302/307).

I addition Google also treats the canonical meta element as a permanent redirect.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-17-2011, 08:56 AM Re: How to 301 Redirect a HTML page?!
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
My mistake. I wasn't sure if the OP was using apache or not. Looking back I should have assumed it was IIS since you can run PHP on either.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 08-17-2011, 09:09 AM Re: How to 301 Redirect a HTML page?!
Ultra Talker

Posts: 366
Name: Steve
Location: Miami, FL, Earth
Trades: 0
IIS Has similar canonical redirect capabilities to Apache. Read this:

http://knowledge.freshpromo.ca/seo-t...p#canonicaliis

Your config would look something like this:

Code:
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="Redirect HTML to ASPX" stopProcessing="true">
          <match url="(.*)\.html" />
          <action type="Redirect" url="http://www.mydomain.com/{R:1}.aspx"
               redirectType="Permanent" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>
__________________
- Steve

President,
Please login or register to view this content. Registration is FREE

Last edited by smoseley; 08-17-2011 at 09:17 AM..
smoseley is offline
Reply With Quote
View Public Profile Visit smoseley's homepage!
 
Old 08-17-2011, 09:16 AM Re: How to 301 Redirect a HTML page?!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Provided the rewrite module is installed yes, but unless you have server access or a host that will or has installed it you are back to quare one.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-17-2011, 03:57 PM Re: How to 301 Redirect a HTML page?!
Experienced Talker

Posts: 32
Trades: 0
Holy #$(% that sounds difficult. I might rel=canonical those bad boys unless you guys think thats a horrible idea, haha.
jpf566 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How to 301 Redirect a HTML page?!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.40317 seconds with 12 queries