Questions tagged [redirect]

HTTP or HTML mechanisms used for redirecting browsers to where the actual content is located

Tag for questions related to issues with configuration of redirects in HTTP servers, problems they may cause or solve.

Redirections are used to redirect user traffic to new location of content, as a way to handle errors or for load balancing.

They are usually implemented with HTTP redirects have status code beginning with 3. Examples include:

301 Moved permanently
302 Found (past "Moved temporarily")
2240 questions
27
votes
4 answers

Redirect all http requests behind Amazon ELB to https without using if

Currently I have an ELB serving both http://www.example.org and https://www.example.org. I would like to set it up so any request pointing to http://www.example.org is redirect to https://www.example.org. The ELB sends the https requests as http…
Jordan Reiter
  • 1,260
  • 4
  • 17
  • 38
26
votes
2 answers

how do I get nginx to forward HTTP POST requests via rewrite?

My iOS app is currently accessing domain A via http POST but I would like to forward all requests to domain B. If I use the usual rewrite ^/(.*)$ http://mydomain/$1 permanent; the POST data seems to get lost. How can I pass HTTP POST data to a…
Jiho Kang
  • 967
  • 2
  • 9
  • 8
22
votes
4 answers

How to continue redirecting stdout to a file after logrotate moves it?

I have a simple script which outputs a bunch of logs to screen and I piped the STDOUT to a file to store the logs. Since this script is long running, I needed to rotate the log files so they are chucked into smaller more manageable ones. The problem…
Mehran
  • 519
  • 1
  • 5
  • 19
21
votes
2 answers

Can you use Redirect and Proxypass at the same time

I am using Apache 2.2.15 on CentOS to provide SSL for a TomCat application. ProxyPass / http://127.0.0.1:8090/ connectiontimeout=300 timeout=300 ProxyPassReverse / http://127.0.0.1:8090 This works fine and everything is great; however, I want to…
bombcar
  • 313
  • 1
  • 2
  • 5
20
votes
2 answers

nginx rewrite for an url with parameters

I have an URL of this type: http://www.example.com/?param1=val1¶m2=¶m3=val3¶m4=val4¶m5=val5 And I want to redirect it to this one: http://www.example.com/newparam/val3/val4 So I have tried this rewrite rule with no success: rewrite…
David Morales
  • 685
  • 1
  • 5
  • 14
18
votes
2 answers

Redirect all requests to HTTPS, except for one subdirectory

I'm trying to move from self-signed certificates to Let's Encrypt certificates on my nginx webserver. Currently, I redirect all requests to http/80 to https/443, which uses a self signed certificate I created a while ago. Now - from what I…
SaAtomic
  • 329
  • 2
  • 10
17
votes
2 answers

Nginx: Redirect IP address to domain name

With the following Nginx config: server { listen 80; listen [::]:80 default_server ipv6only=on; server_name isitmaintained.com; ... } server { listen 178.62.136.230:80; server_name 178.62.136.230; add_header…
Matthieu Napoli
  • 400
  • 1
  • 3
  • 11
17
votes
5 answers

How can I enforce that my urls always start with www?

I want to ensure that users come to www.mydomain.com even if they arrive through the alias mydomain.com. This is so that I have control over cookies on subdomains, and so that Google sees one single domain and not a hodge-podge of URLs. How can I do…
Magnar
  • 1,017
  • 2
  • 11
  • 15
16
votes
4 answers

Is an SSL Cert needed for redirects?

We currently have a website set to redirect to a new address (our client changed domain names, but wants the old domain to send people to the new site) in IIS 8.5 using permanant redirects found in the 'HTTP Redirect' feature for the site. The SSL…
Jeff
  • 313
  • 2
  • 3
  • 8
16
votes
3 answers

How do i reach IPv4 addresses from an IPv6-only network?

I would like to reach this address via an IPv6 address: http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/ In our Freifunk routers there is no DNS available, so the name downloads.openwrt.org cannot be resolved. All…
rubo77
  • 2,282
  • 3
  • 32
  • 63
15
votes
4 answers

How to redirect requests to a different domain/url with nginx

I'm trying to redirect all users coming to a URL "http://example.com/something" to a URL like "http://answares.com/examples_com/something". I'm trying with code like this: server { listen 1.2.3.4:80; server_name "example.com"; rewrite ^(.*)…
user93656
  • 253
  • 1
  • 2
  • 5
14
votes
3 answers

How to redirect all outgoing email from postfix to a single address for testing

I am setting up a testing server for a web based application that sends some email notifications. Sometimes testing is performed with real customer data, and for that reason I need to guarantee that the server is not able to send emails to our real…
0x6A75616E
  • 661
  • 3
  • 10
  • 24
14
votes
4 answers

How to redirect HTTP to HTTPS on AWS Application Load Balancer?

Our website needs HIPAA compliance so everything needs to be encrypted. I don't want client to get an error message when they put in "http://mysite.com", so I need to support both HTTP and HTTPS, and redirect HTTP to HTTPS. Am I right? I did it…
Silly Dude
  • 549
  • 2
  • 6
  • 19
14
votes
2 answers

Nginx multiple roots

I'd like to divert off requests to a particular sub-directory, to another root location. How? My existing block is: server { listen 80; server_name www.domain.com; location / { root /home/me/Documents/site1; …
14
votes
2 answers

Apache2 - 301 Redirect when missing "/" at the end of directory in the url

I haven't really noticed this Redirect(301) when requesting a url like this without slash("/") at the end: http://server/directory The server will respone with a 301 Redirect Permanent header with a Location header locating to…
Jonathan Gurebo
  • 235
  • 1
  • 2
  • 6