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)

1
vote
0answers
6 views

Hyphen character encoded as “%2D” with IIS6

A customer has set up a website on a server IIS6. In older versions of Firefox, they have a problem with a URL containing a hyphen character. When they request http://www.example.es/mas-info they ...
16
votes
2answers
25k 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; ...
1
vote
0answers
20 views

Confirming code for redirect main domain but not the sub-domain

We first had (22 years ago) the domain silver-cross.com and a few years later acquired silvercross.com Currently, silver-cross.com and silvercross.com are both using the same index file & we would ...
1
vote
1answer
2k views

301 redirect Rule For Load Balance F5 BigIp

I have a load balancer F5 Big ip for my website. Currently, I am having 302 redirect in place; however, I wanted to apply 301 but dont know how. For example: My website (abc.com) when typed 302 ...
1
vote
2answers
276 views

Wordpress non-www to www redirect loop in NginX

I deployed my wordpress website on NginX successfully. I need permalinks to be http://www.example.com/%postname% and blog to be http://blog.example.com/%postname%. It redirects all www traffic to ...
0
votes
3answers
54 views

Nginx 301 redirect https to http

I have a strange issue with a trailing / I'm using nginx and it is functioning correctly with one small exception. I have the following site config server { listen 80; return ...
-1
votes
1answer
182 views

HTTP 301 moved for all nginx URL to a single HTTPS

Below is a config file that I am using with Nginx to redirect all WWW and non-WWW to the https:/domain.com URL server { listen 80 443; server_name domain.com www.domain.com; ...
0
votes
2answers
1k views

cname vs 301 redirect on namecheap

I am having trouble figuring out my DNS record types. I want the www subdomain to be my "canonical" page, so my configuration looks like this: www A record type actual ip address @ 301 ...
2
votes
1answer
1k views

nginx return 301 / redirect

among all 'redirect in nginx' questions I couldnt find how to redirect (using return 301 and beteer no ifs) using regexps. I have a link to my website and I'd like to remove parameter a the end: ...
0
votes
1answer
1k views

IIS 8 URL Redirect on site level

I am trying to do a simple 301 perm redirect to another url in IIS 8. The end results would be if i navigated to domain2.com i would end up on domain1.com. We are moving from IIS 6 to a new server ...
1
vote
1answer
16 views

Redirection with subdirectories urls in Nginx

When with my browser, I do a call to http://myhost/tiles/yellow/1/2/3.png, I would expect to get content from http://myhost/cache/yellow.png My configuration is the following location /cache/ { ...
1
vote
2answers
37 views

Apache httpd does not implement updates to a 301 redirect configuration

I'm having a problem updating a previously-working redirect in my apache server (httpd, rhel). I'd previously had: RedirectMatch 301 ^/apidocs/ /old/specific/path/apidocs/ which worked. I changed ...
1
vote
3answers
1k views

Nginx: 301 redirect without query strings

I am redirecting /example.php?var=value to /index.htm like this: rewrite /example.php?var=value / permanent; However, the browser ins printing the final uri like this: domain.com/?var=value How ...
-2
votes
1answer
20 views

How to redirect between Wordpress site using .htaccess if the origin has .html [closed]

How to redirect between Wordpress site using .htaccess if the origin has .html the first site i use permalink .html example: www.domain.com/articles/content.html if i'd like to use 301 redirect to ...
0
votes
0answers
49 views

Nginx redirects http request to one vhost

I have installed nginx with php-fpm. When I try to access example.org it redirects me to https://example.com What's wrong with my configs? nginx.conf user www; worker_processes 1; ...
0
votes
2answers
198 views

301 re-direct www to non-www on NGINX with Varnish enabled

I'm really hoping someone can help me with this. After a lot of searching I haven't been able to find the solution. I am running my website on NGINX and have Varnish enabled however, when I try to ...
1
vote
2answers
6k views

How to redirect example.com from HTTPS to HTTP, then HTTP example.com to newdomain.com?

As of now I use this rule (in .htaccess of example.com) to redirect HTTPS/HTTP example.com to newdomain.com: Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://newdomain.com/$1 ...
3
votes
4answers
6k 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", ...
-2
votes
2answers
46 views

Is Apache RedirectMatch a good solution for these urls [closed]

I have a Rails app which is throwing exceptions when I get some strange urls with lots of garbage characters. For example ...
1
vote
2answers
706 views

Lighttpd Redirect to SSL results in 301 redirect loop

I am running lighttpd 1.4.31 with ssl support and am having an issue with forcing https on a specific virtualhost. If I disable the redirect line from the following config, it works as expect (http ...
2
votes
1answer
607 views

302 redirect loop with nginx and Wordpress

I've been searching a couple of hours in Serverfault trying to solve this problem but I can not find a solution. What happens is: I am having a 302 redirect loop using wget in my site, but not using ...
-1
votes
1answer
33 views

Trying to get nginx to return 301, preserving $_GET

I'm having trouble configuring nginx to return the url I want. I'd like http://domain.com/blah?abc=e9800ecf8 to return http://domain.com/createpage.php?abc=e9800ecf8, i.e. it preserves the abc ...
0
votes
1answer
56 views

Nginx redirects not getting used

I have an nginx.conf file that looks something like this: http { server { listen 80; server_name myapp.org; return 301 http://www.myapp.org$request_uri; } server { ...
0
votes
1answer
452 views

nginx redirect loop with proxy_pass and $http + CloudFlare

My nginx configuration works great until I add a redirect that forces HTTPS. The working config before the redirect is is: server { listen 80; listen 443 default_server ssl; server_name ...
-1
votes
2answers
67 views

301 redirect help needed for urls with parameters

How do I 301 redirect all urls such as http://domain.com/languages/italian/itemlist.feed?start=[0-9]&format=feed http://domain.com/languages/italian/itemlist.feed?format=feed&type=rss to ...
1
vote
1answer
50 views

Lighttpd redirect non-www to www

I want to redirect all non-www to www on my domain. But when I use this code provided by some websites, and do a graceful restart of the lighttpd server, my website doesn't function anymore - at ...
3
votes
3answers
263 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
9k 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 ...
0
votes
0answers
78 views

Redirect the direct links to static files from non-www to www

My website is using WordPress 4.1.1, multisite, subdomain install. I've changed it from non-www to www successfully after updating the database ( ...
1
vote
2answers
176 views

Mass 301 redirects with Varnish

I'm working on migrating a site to another platform. We have a Python script to handle the import and we're considering using Varnish for speed. I want to make sure all existing URLs remain functional ...
4
votes
1answer
208 views

Apache Redirect Permanent Not Working

I have two redirects on my site. One of them is working, and one of them is not. Here are the relevant lines from my configuration, edited to protect the innocent. <VirtualHost *:80> ServerName ...
0
votes
1answer
107 views

firefox vs chrome behave different 301 redirect

I have this nginx config: worker_processes 1; error_log /home/paolino/error.log notice; events {worker_connections 1024;} http { include mime.types; default_type ...
164
votes
5answers
33k 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 ...
-1
votes
1answer
36 views

New domain and HTTPS redirects [duplicate]

I have a domain.co and just bought domain.com and want to use SSL on it. Having in mind this H5BP apache config for HTTP to HTTPS redirect: <IfModule mod_rewrite.c> RewriteEngine On ...
1
vote
1answer
101 views

Why is https://www.foobar.com redirecting to itself?

I don't have any rules that suggest https://www.foobar.com should redirect to https://www.foobar.com. But why is it doing that? This is my curl output: curl -Ik https://www.foobar.com HTTP/1.1 301 ...
0
votes
3answers
613 views

Nginx: Redirect both http and https root to subdirectory

I'm attempting to redirect the root domain for both http and https in nginx to the same subdirectory (https): So e.g. http://example.com -> https://example.com/subdirectory https://example.com ...
0
votes
0answers
31 views

Combining a 301 and aliases in Apache VirtualHost blocks

I manage (just about) Apache and VirtualHosts for the server and am trying to determine the most efficient and SEO-friendly method for a client with: an old domain/dirs/ that needs a 301 to a new ...
0
votes
0answers
287 views

IIS 8 Win 2012 R2 - Rewrite redirect not working, page not found, address not changing

I have an MVC4 app and trying to rediret pages so that both http://example.com/about and https://example.com/about direct to https://example.com/about (where about could be any other page also). I ...
1
vote
1answer
636 views

Getting “Too many redirects” error with nginx rewrite rule

I am trying to rewrite the domain url that targets my site such that all domain names are rewritten to www.example.com and have the following config: mysite block server { listen ...
1
vote
1answer
480 views

Nginx Server Blocks: https, non-www, & non-ssl subdomain

Here's my scenario: Two sites: https://example.com http://dev.example.com Site 1 has a ssl certificate. Site two does not. (In other words, I don't have a wildcard ssl certificate.) With ...
1
vote
2answers
215 views

Can I make Apache ErrorDocument return 404 instead of 301?

In my .htaccess I have ErrorDocument 404 http://foo.com/404.html It works, in the sense that I recover from any file not found error and show the 404 page instead, but the way it works is to ...
1
vote
1answer
64 views

nginx 301 redirects not working as expected

I have added the following rules to my nginx.conf file rewrite ^/top100/Armin%20van%20Buuren/(.*)$ http://www.example.com/armin-van-buuren/$1 redirect; rewrite ^/top100/armin-van-buuren/(.*)$ ...
0
votes
0answers
138 views

<SOLVED>IIS7 HTTP Redirect not working correctly for my use

quick overview of our network. One WAN IP, two win 2k8 web servers. Initially one was for our public sites, the other was for our internal sites. Using a router as a firewall / NAT device. We now ...
0
votes
0answers
50 views

Enable charset header in nginx 301

I have nginx redirecting http requests to https. Currently the header in the redirect is Content-Type: text/html. I want it to be Content-Type: text/html;charset=utf-8. Here it says I need a custom ...
0
votes
1answer
315 views

nginx: Multiple cross-domain 301 redirects with different page addresses

I'm moving my old site over to a new domain, and with that new domain comes new naming conventions. I'm trying to figure out what would be the simplest way of accomplishing the following for roughly 8 ...
0
votes
1answer
87 views

Domino SSL 301 redirect with www and non www

With reference to this question How to do a 301 redirect from http to https in a domino server? My redirects are failing. (gaps between protocol and : are because i dont have the rep to post multiple ...
0
votes
1answer
34 views

How to use parts of the old URL in a 301 redirect [duplicate]

is it possible to keep certain parts of an URL and to rewrite the rest? With a .htaccess 301 redirect. In my example I would like to rewrite URLs from this format http://blog.example.com/post-name ...
0
votes
0answers
71 views

Redirect an old existing opencms url to new joomla url

I am currently working on redirecting the old url of one of our opencms site to the new url which is in the joomla platform. I've been trying for some time now but I can't seem to get it. I have tried ...
0
votes
0answers
32 views

Permanent redirect from machine behind load-balancer

I suppose you've seen questions about Google indexing both the domain name and IP address of a site. I have a similar problem, except there's a load-balancer in between, and I have no access to this ...
0
votes
0answers
55 views

How do I 301 redirect - for all urls of my website to one single page

I have a website: www.example.pro with pages like: www.example.pro/contact-us/ and www.example.pro/about/ I want every URL from this website to redirect to: www.example.com Example: when opening ...