Solved

301 redirect

Posted on 2014-09-17
5
140 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
In this blog, I will share you some basic tips for content marketing and to rank your website on Google.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
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…

774 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