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

learn more… | top users | synonyms (1)

174
votes
5answers
40k 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 ...
21
votes
2answers
32k views

Nginx reverse proxy + URL rewrite

Nginx is running on port 80, and I'm using it to reverse proxy URLs with path /foo to port 3200 this way: location /foo { proxy_pass http://localhost:3200; ...
2
votes
1answer
3k views

IIS 6 - Setting up 301 redirect for non-www to www for SEO

Someone in the marketing department ran an SEO tool against our public website and found that about half of the links to our website go to www.mycompany.com, and half go to mycompany.com. Both of ...
12
votes
2answers
2k views

best way to handle thousands of permanent redirects

We've a list of 3000 301 redirects. We need assistance on What would the best place to put these? It seems putting these 3000 lines inside vhost in httpd.conf would be a mess. What are recommended ...
3
votes
4answers
7k 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", ...
0
votes
1answer
373 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.
8
votes
1answer
3k views

Empty/Null Apache request entries in access log

This entry got logged in a Apache access log: IP ADDRESS - - [00/00/0000:00:00:00 -0000] " " 301 - "-" "-" It was detected by LogWatch as a null HTTP Response and also got marked as a successful ...
3
votes
3answers
281 views

The 301 'www' nightmare. How do I change back?

About six months ago, I decided it would be best to put my website on the naked domain, let's just say 'example.com'. I did what all the instructions websites have told me with adding a 301 redirect ...
3
votes
1answer
10k 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 ...
3
votes
2answers
5k views

How to configure nginx to redirect all request from domain aliases to main domain?

I do have an nginx server which responds to several domains and I do want to redirect all request to the main domain. Example: website responding for xxx xxx.example.com yyy.example.com $hostname for ...
0
votes
1answer
47 views

Redirecting depends of Variables in Header

Issue I've difficulties to understand if it is possible to do redirects depends of variable in Header using Domino server (R9). AIM Redirect all requests (for 1 particular website) to: ...
0
votes
1answer
536 views

.htaccess 301 redirect, same server

I set up a website at mywebsite.net, but recently bought the domain mywebsite.com. Now I updated the information on Google via Webmaster Tools and it recommended we set up a 301 redirect from the ...
0
votes
3answers
1k 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: ...
0
votes
1answer
949 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
2answers
436 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 ...