Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [301-redirect]

The HTTP response status code 301 Moved Permanently is used for permanent redirection. This status code should be used with the location header.

2
votes
1answer
6k views

Apache permanent redirect not working

Trying to redirect an old URL in Apache. But I can not figure out what is wrong with this: <Directory "/home/site/www/"> RewriteEngine On Options +FollowSymLinks Redirect permanent /test http://...
0
votes
1answer
94 views

Help with Apache Redirect 301

I recently moved my blog on to my company website and did a 301 redirect for all the content of my blog. However I want to redirect my the base url (www.oldblog.com) of my old blog to my new company ...
1
vote
1answer
7k views

Nginx redirect loop

I am trying to transfer a site from one server to another. I normally use apache, but this project was using nginx and Ultimate SEO for url modification. I am using the same nginx config file but I am ...
0
votes
3answers
5k views

How to 301 redirect a single file or directory on a GoDaddy shared Windows hosting plan?

I've seen a few posts about redirecting domains on GoDaddy, but nothing about single files. In my case I am using a Windows shared host, so I can't use any IIS management tools. What I'm hoping is ...
0
votes
1answer
544 views

Apache .htaccess 301 permanent redirect

How can I make it so that whenever a page on mydomain.com is accessed without www to go to www.mydomain.com, please? Thank you.
1
vote
1answer
5k views

.htaccess 301 redirect produces 500 internal server error

I've added individual 301 redirect entries to .htaccess to redirect my old site's Mambo pages to the new site's Joomla pages, but the old URLs still generate 404 errors. Any ideas why? The format I ...
0
votes
1answer
125 views

several hundred redirects, whats the most efficient way of configuring them?

I am aware that having too many redirects in a .htaccess file can lead to a loss of performance in apache, this leads me to my question is there a faster way to configure redirects in apache ...
0
votes
1answer
72 views

.htaccess to rewrite migrated Wordpress site

I've moved my Wordpress from one domain to another, and I want the use .htaccess 301 redirects to redirect posts on the old domain to posts on the new domain. My webhost suggested I try the following:...
0
votes
4answers
1k views

point multiple domain to single web hosting account

point multiple domain to single web hosting account using htaccess i have used the following .htaccess file in my public_html directory RewriteEngine on RewriteCond %{HTTP_HOST} ^site1.org$ [OR] ...
0
votes
1answer
344 views

Use mod_rewrite or RedirectMatch to redirect oldfile.aspx?p=blah to newfile.php, ignoring ?p=blah

I've got a site with many incoming links to the old structure (gone for years), with tonnes of URL vars that are no longer relevant, as the database mappings were changed. So, I'd like to redirect: ...
6
votes
1answer
4k views

Best way to do a 301 redirect from non-www to www. in IIS7.5?

What's the best way to do a 301 redirect from non-www 'somedomain.com' to 'www.somedomain.com' in IIS7.5? Thank you
0
votes
2answers
301 views

After 301 move I have lost previous positions on Google

I moved my site recently from brandonwang.org to brwang.com. I went online and found this lovely snippet of code (below) and modified it a bit. This is my .htaccess file in it's entirety for ...
2
votes
3answers
828 views

How can use mod_rewrite to redirect a multiple specific URLs containing multiple query strings?

we recently migrated a site from a custom CMS to drupal. In an effort to preserve some links that our users bookmarked (we have about 120 redirects) we would like to forward the original URLs to a new ...
1
vote
3answers
3k views

mod_ReWrite to remove part of a URL

Someone has incorrectly linked to some of my urls causing 404 erros in Google Webmaster Tools. Here is an example Linked URL: http://www.example.com/foo-%E2%80%8Bbar.html Correct URL: http://www....
261
votes
5answers
94k views

Redirect, Change URLs or Redirect HTTP to HTTPS in Apache - Everything You Ever Wanted to Know About Mod_Rewrite Rules but Were Afraid to Ask

This is a Canonical Question about Apache's mod_rewrite. Changing a request URL or redirecting users to a different URL than the one they originally requested is done using mod_rewrite. This includes ...
0
votes
1answer
144 views

What is a good way to facilitate 60,000 “301” and “200” redirects for a single website?

The set of redirects is not static. We will be adding and removing redirects more than a dozen times per day. We happen to be using a CMS (DotNetNuke) that has some redirection capability built-in, ...
0
votes
2answers
2k views

Fastest loading: Redirect with header location in PHP, or Rewrite with Apache?

after becoming aware of the major lag that hits my site becaouse of the homepage redirect, i read into numerous optimization threads, proving that a 301 redirect slams out approximately 100ms to a ...
0
votes
2answers
1k views

301 redirect or disallow on robots.txt?

I recently asked for 301 redirection on ServerFault and I didn't get a proper solution to my problem, but now I have a new idea: use the robots.txt to disallow certain URLs from my site to be "crawled"...
0
votes
1answer
2k views

Nginx 301 redirection for WordPress after migration

We recently did a migration from a "custom CMS" (coded from scratch) to our current technology news/reviews site, MuyComputerPRO, which we installed in WordPress a couple of weeks ago. The migration ...
0
votes
1answer
921 views

Apache 310 redirect with wildcard URL

I'm trying to redirect this... http://www.wfmc.org/administrator/components/com_civicrm/civicrm/extern/url.php?u=878&qid=3686395 -- Where '&qid=3686395' varies from link to link. How can I ...
1
vote
1answer
3k views

Possible to redirect all traffic from www.***.com to ***.com, in IIS7?

notice how ServerFault.com has no subdomain? If we want to do the same thing with our website -> redirect all traffic from www.***.com to ***.com, how can we do this? At first, I thought it might be ...
0
votes
1answer
119 views

How to enable WordPress to have multiple sites without a re-direct

I'm using WordPress to manage my site and when the site does a re-direct, it slows down performance. For example, WordPress allows you a single default site, www.mycompany.com. If a user goes to ...
4
votes
4answers
13k views

How to redirect non-www to www without hardcoding using .htaccess?

RewriteEngine On RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] ...causes a perfect, non-hardcoding 301 redirect from "www to non-www", ...
1
vote
2answers
637 views

Should a 404 ever be used in conjunction with a 301-redirect?

I'm working with a hosting company. I need them to setup a 301 redirect for one of my pages. I really care about the ranking on the search engines for this particular page. They claim that in order ...
0
votes
1answer
5k views

What's causing this 301 redirect loop?

I have several Redirect directives in my Ubuntu /etc/apache2/sites-available file: Redirect 301 /rss.xml http://example.com/feed/index.xml Redirect 301 /atom.xml http://example.com/feed/atom/...
0
votes
3answers
3k views

Redirecting example.com/* to www.example.com/*

I just moved to a new host and they've got a different control panel than the one I was using before. On my old host, all domain.com/* addresses were 301 redirected to www.example.com/*, without me ...
0
votes
2answers
2k views

How to redirect http traffic to sub directory, without breaking application in subdirectory?

I have my main domain URL mapped to the root of my server I have a wordpress installation installed under /blogs/techblog I want to direct any traffic coming in at jameselsey.co.uk to > jameselsey....
0
votes
1answer
128 views

mod_rewrite, 301 problem

Currently I can access specific site in two ways: 1. http://a.com/foo/bar 2. http://a.com/index.php?url=foo/bar What I'm trying to achive is to allow to do it only using first way, and make ...
0
votes
2answers
167 views

safe 301 redirection using htaccess for two domains

I have two domains, a new domain (newdomain.com) and and old legacy domain (olddomain.com). I want to safely redirect the old domain to the new domain. Easy enough. At the moment I am doing this ...
0
votes
2answers
76 views

new domain name while retaining the web hosting

I have client/customer level rights to a 3 yr. old domain + windows web hosting (IIS web server) for http://www.22shrutiharmonium.com and it has html and asp pages. Now, I need to change the domain ...
3
votes
1answer
15k views

How to permanently redirect port 8080 URL to port 80 using nginx

Because of my carelessness, I put http://www.domain.com:8080/xxx/index.html on the internet. I don't want to lose that traffic, so i want to permanent redirect that url to http://www.domain.com/xxx/...
0
votes
1answer
2k views

Infinite redirect loop?

I want dev.test.com, to go to a specific directory, /var/www/cakephp/dev/webroot. Here's my apache2 conf file: <VirtualHost *:80> ServerName dev.test.com Redirect permanent / /...
0
votes
2answers
1k views

How do you redirect pages from a directory to a subdirectory?

I had recently moved all the content on my website from being in the www.mysite.com/shop directory to being in the root directory. This means that I needed to redirect any request to visit a page with ...
1
vote
1answer
3k views

Cannot 301 redirect with IIS URL Rewrite Module

I am trying to troubleshoot my issue with the URL Rewrite Module on IIS 7. I migrated a Wordpress blog over to BlogEngine.net. There were only about 5 entries that I wanted to use 301 redirects to ...
1
vote
3answers
1k views

301 redirect from mydomain.co.uk to www.mydomain.co.uk using IIS

I soon will be purchasing a virtual windows server and will be using IIS7 I’m keen for SEO purposes to 301 redirect any users from mydomain.co.uk to www.mydomain.co.uk, but as I have root access to ...
1
vote
2answers
1k views

301 Redirect and query strings

I am looking to create a 301 redirect based purely on a query string see b OLD URL: olddomain.com/?pc=/product/9999 New URL: newurl.php?var=yup My normal way of doing this would be redirect 301 pc=...
0
votes
1answer
485 views

Apache 301 redirect

I have inherited a server with a couple of domains on it. The website was reworked within the last two years and I am trying to oblige a request by staff to get a redirect to work properly (if it can ...
6
votes
4answers
6k views

IIS 301 Redirect from “/index.html” to “/” for SEO Canonicalization

I used the technique explained here for IIS (http://www.webconfs.com/how-to-redirect-a-webpage.php), but this appears to result in an infinite loop when applied to "/index.htm" and redirected to "/". ...
0
votes
1answer
249 views

Nginx server matching too many URLs

I've got a domain example.com and an "alternative" of some-example.com. I'm trying to direct traffic from some-example.com to example.com using a simple server declaration in nginx as follows: server ...
0
votes
2answers
529 views

Can reduce the rewriteRule to one rule from multiple RewriteConds for 301 in htaccess?

I am doing 301 redirects for old sites to a single site, rather then having to add the same RewriteRule more then once, is there a way to say write it once? that way i just need to add the rewriteCond ...
0
votes
2answers
2k views

How to use 301 redirect in .htaccess by IP address?

I have transferred the website to different webhosting. Some users see old website since their DNS servers point to old webhosting IP. How can I alter the .htaccess in the old website to tell their ...
0
votes
3answers
2k views

301 redirecting second domain to first via htaccess, mod_rewrite whilst preserving subdomains - any tips?

I've been hunting around the tubes today, but given my limited mod_rewrite and regular expression knowledge I'm struggling. What I'm trying to achieve is a rewrite of domain1 (including subdomains) ...
1
vote
2answers
2k views

Redirect permanent www.url.com --> www2.url.com

i have trouble to redirect (via .htaccess) an url like this: www.url.com/index.php?option=com_content&task=view&id=60&Itemid=22 to www2.url.com/something.htm I figured out that the ...
3
votes
1answer
79 views

What is the correct way to move an rss feed? Is there a temporary workaround for google reader users?

I run a website that has published its RSS feed at a given location for years. However, I'm now forced to move the feed to another URL. Let's say the original URL was www.example.com/rss.xml and the ...
0
votes
2answers
2k views

Apache2 - mod_expire and mod_rewrite not working in httpd.conf - serving content from tomcat

I am using apache2 server running on debian which forwards all the http request to tomcat installed on same machine. I have two files under my /etc/apache2/ folder apache2.conf and httpd.conf I ...
0
votes
1answer
84 views

switch mod rewritten URL

We are using a mod rewritten URL within our PHP site, this is the rewrite rule we are using: RewriteRule ^category/([^.]+)/([0-9]+)/([^.]+)/([0-9]+) categories.php?c_id=$2&filters=$3&_p=$4&...
0
votes
1answer
96 views

Does anyone have some stats on the effects of having large amounts (over 100) of redirects in apache conf?

We recently trasferred over a blog to a new site and had to setup a couple of redirects from the old articles to their new location. Now, the problem here is that we found out that on his old site he ...
0
votes
2answers
178 views

301 Htaccess Redirect

Need help with an 301 htaccess redirect cond and rule doing the following for all the files in these paths: www.name.com/wordA/wordB/* to www.name.com/new_word/wordA/wordB/* we are basically adding "...
0
votes
2answers
288 views

Unexpected behavior with htaccess Redirect 301

I have the following in my .htaccess file- Redirect 301 / http://www.foo.com/south-carolina-real-estate/ Redirect 301 /related/aiken-sc.htm?tkn=...
0
votes
1answer
408 views

301 IIS Redirect

How do I 301 direct all traffic from domain1.com to domain2.com using IIS? Also I need domain1.com/page.aspx?params to direct to domain2.com/page.aspx?params.