Solved

301 redirect

Posted on 2014-09-17
5
142 Views
Last Modified: 2014-09-28
Trying to implement a 301 redirect and am told by the site below that it isn't working:

http://www.best-seo-tools.net/301check/Default.aspx

I have tried (trying to redirect acesestimating.com to www.acesestimating.com):

Tried:
rewritecond %{http_host} ^acesestimating.com [nc]
rewriterule ^(.*)$ http://www.acesestimating.com/$1 [r=301,nc]

Tried:
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

Tried:
RewriteCond %{HTTP_HOST} ^acesestimating.com [NC]
RewriteRule ^(.*)$ http://www.acesestimating.com/$1 [L,R=301]

Thoughts?
0
Comment
Question by:classnet
  • 3
5 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40328274
RewriteEngine On
RewriteCond %{HTTP_HOST} ^acesestimating.com
RewriteRule (.*) http://www.acesestimating.com/$1 [R=301,L]

Open in new window

0
 

Author Comment

by:classnet
ID: 40328516
Ok... turns out that 1and1 hosts their php pages on IIS... which, I think, explains why Gary's answer won't work.

The code below is supposed to work within the web.config file:

    <rewrite>
        <rules>
        <rule name="Redirect to WWW" stopProcessing="true">
          <match url=".*" />
          <conditions>
            <add input="{HTTP_HOST}" pattern="^acesestimating.com$" />
          </conditions>
          <action type="Redirect" url="http://www.acesestimating.com"
               redirectType="Permanent" />
        </rule>
      </rules>
    </rewrite>

This crashes the site altogether when I attempt to add this bit of code to the existing web.config file.  The existing file only contains a default document (index.php) section.

Any other thoughts?
0
 

Accepted Solution

by:
classnet earned 0 total points
ID: 40338670
I think we can delete this question...  I am moving the site from an IIS (MS) server to an Apache server and will use the .htaccess file.
0
 

Author Closing Comment

by:classnet
ID: 40348365
I have given up on the MS IIS server and am moving to Apache.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Scheduled IIS .Net2 AppPools recycle and SQL connection Hangs 33 146
Error viewing ASP page 12 176
mimic google as my ip 11 80
SSL Certificate for IIS7 Site 2 94
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question