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.

3
votes
1answer
44 views

Apache htaccess redirect?

I have a client who has a domain like this-site.com and also thissite.com Without going into the entire issue behind it, we need to redirect any incoming request to any *.this-site.com to the matching ...
1
vote
1answer
333 views

nginx and redirection from another domain

So I have www.old-domain.com and we've just transferred to www.new-domain.com old-domain.com's server had an SSL certificate and could handle both http://www.old-domain.com and https://old-domain.com ...
1
vote
1answer
2k views

.htaccess redirect all domains, with paths, to one

I have three domains all pointing to the same hosting space, mirrored using A records: example.org example.org.uk example.co.uk I have a website on the root (/), and a MediaWiki installation at ...
15
votes
2answers
27k views

Best way to redirect all HTTP to HTTPS in IIS

We want ALL sites on our webserver (IIS 10) to enforce SSL (ie redirect HTTP to HTTPS). We are currently 'Requiring SSL' on each site and setting up a 403 error handler to perform a 302 redirect to ...
1
vote
0answers
324 views

Windows web config redirect, different folder name and domain

I have 2 websites and a few thousands links with the same pattern that need to be redirected. I want to achieve this by writing the code one time and for it to work for all of the URLs. This is the ...
-2
votes
1answer
273 views

how to redirect old html url to new php Url [duplicate]

How to redirect old html page to new php page. I used this code but it redirecting with full file path. I'm using below code. RewriteEngine On RewriteRule ^(.*).html$ $1.php
0
votes
1answer
416 views

NGINX 301 list of redirects SEO

I have about 250 URLS that need to be redirected from an old site to new. In the server block I set this statement: include /etc/nginx/301s/somesite.conf; Then in the included file I have a list of ...
0
votes
1answer
168 views

Unwanted 301 Redirect for new VirtualHost for subdomain

For the last 3 years I've had 2 copies of my Wordpress website. One at www.domain.com and one at dev.domain.com. I'm trying to add a third today. Seems simple enough! I go through all the simple setup ...
0
votes
1answer
1k views

Redirect naked domain to www with SSL in cloudfront/route 53

I have setup two buckets on s3 one for my actual angular 2 app: www.example.com and one for redirecting example.com to www.example.com. I have also created two distributions in cloud front and added a ...
1
vote
1answer
2k views

CNAME redirect to external https url

I have a somehow specific setup. It really is due to some restrictions I cannot work around: There are domains 1. and 2. which I own and an external URL which I don't own: start.com root.com http://...
1
vote
0answers
50 views

How to 301 redirect piece by piece?

I will move my blog website (monthly traffic of 250k) to a new domain name. I will use HTTP 301 redirections. But I should not redirect all links at the same time because of some business reasons. I ...
1
vote
2answers
899 views

NGINX - return 301 keeps redirecting to HTTP instead of HTTPS

I have the following configuration: server{ ssl on; listen 443 ssl; ... location = / { return 301 https://$host/appName; } location = /appName { ... proxy_pass $...
0
votes
1answer
207 views

dual behaviour on passing referrer between http and https with 301 redirects

We have a client that is using https but has two 301 redirects, first redirect from https to http, and second from http to https. One of his referrers is sending from https referrer to https but the ...
1
vote
1answer
781 views

nginx won't redirect http to https

I have a nginx docker running, with multiple site-config files. One of those is just a general redirect for all http connnections to https: server { listen 80; server_name *.example.com example.com; ...
0
votes
1answer
240 views

IPTables Forwarding Port 8080 to 80

My hardware firewall has port 8080 open My goal is to have my server receive the requests over 8080 and via iptables route the request to be handled by httpd. This seems simple (in my head), but I ...
0
votes
1answer
87 views

Leverage 301 HTTP code for email address migration

Is it possible to leverage HTTP 301 Moved Permanently for email address migrations to ask the sender to sender the further messages to another email address? UPDATE I'm aware of differences between ...
1
vote
1answer
98 views

How to check is canonicalized domains are being used? Apache 301 redirect does not preserve referrer

I have multiple domains which are setup to redirect (301) to my main domain. However I know some of these domains have little to no value in terms of SEO and I would like to get rid of them. But a ...
1
vote
1answer
117 views

Prepend “player-” before numeric URLs with the help of HAProxy 1.5

I run a web game embedded in Wordpress/Jetty behind HAProxy 1.5 on CentOS 7 Linux. The website can be accessed both as http and https. I have modified Wordpress to display player profile pages at ...
0
votes
0answers
342 views

Can't redirect http:// to https:// via nginx

Good day everybody, I have set up an Nginx Webserver on an Ubuntu instance. I have configured the /etc/nginx/sites-enabled/default file like this: server { listen 80; ...
0
votes
1answer
534 views

Redirecting from www to no www in nginx reverse proxy

I'm developing a Django app with nginx reverse proxy and gunicorn application server. Being a newbie web developer, I need help with redirecting www traffic to no www at the webserver level. I'm ...
-1
votes
1answer
2k views

NGINX redirect if user agent contains XYZ

I have redirected my site from http to https. I want to allow the useragent XYZ and XYZ whatever to enter both http and https versions. Now the vhost looks like this: server { listen 80; ...
-1
votes
1answer
1k views

Redirect non-www to www over SSL in apache not working

My virtual host file: <VirtualHost *:80> ServerName example.com ServerAlias www.example.com #Redirect non-https or non-www to https://www... RewriteEngine On #NOT TESTING HTTPS REDIRECTION FOR ...
0
votes
2answers
368 views

How to redirect root domain to www using Openshift v2 and nginx?

I am not able redirect my example.com request to www.example.com and they are now both different websites, pointing to the same application. Background: I have installed php 7 with nginx on ...
2
votes
1answer
66 views

nginx redirect from .htm to urls without

Hi a new website is launched. The former website had urls like this: http://example.com/something.htm the new site hasn't and looks like this: http://example.com/something How can I tell nginx to ...
2
votes
1answer
49 views

Best way to redirect a bad-rated domain to a new one?

I recently bought a domain that has an Alexa rank of ~50000. However the domain has a poor history as the previous owner didn't responded to abuse emails nor any DMCA notices. Long story short, the ...
0
votes
1answer
48 views

DNS redirect to website directory

We've currently got one DNS record connecting to many web applications in IIS through DNS Made Easy. eg. myDNSName.example.com/Customer1 myDNSName.example.com/Customer2 This worked fine because ...
0
votes
1answer
914 views

Nginx http redirect to https when https proxy_pass

I have an nginx configuration which redirect from http to https, but on the https side the location / {} include a proxy_pass to a Go service. server { listen 80 default_server; listen [::]:80 ...
1
vote
1answer
2k views

How to proxy nginx request to tomcat path?

I have a Domain Name example.com. When enter example.com I want to proxy the request to 127.0.0.1:8080/source My nginx configuration location / { proxy_set_header X-Real-IP $remote_addr; ...
0
votes
0answers
108 views

Can't log in to FTP or /administrator panel after .htaccess redirect

So I had a website that was indexing www and non www versions of every page. I tried to fix it in Joomla (CMS) and here's what happened: In Joomla admin tools' .htaccess maker (via Akeeba), I chose ...
1
vote
1answer
352 views

Apache 301 redirect Query String URL

I want to redirect to one query string URL to another: example.com/product-category/search/?filter_grade-level=154 to example.com/product-category/search/?filter_grade-level=k Any thoughts what to ...
0
votes
0answers
232 views

NGINX redirect results in “DisallowedHost at /”

I have installed nginx on a CentOS 7 box at Azure, and I have configured it like this: server { listen 80; server_name mywhateverdomain.com; return 301 www.mywhateverdomain.com.br$...
1
vote
0answers
169 views

IIS URL Rewrite or Load Balancer for 301 Redirects?

We have a system in place with access to the IIS URL Rewrite Feature. However, I am investigating whether we should do our 301 Redirects using it, on IIS, or do them at the Load Balancer stage instead?...
0
votes
0answers
430 views

Https URL without slash is redirected to http version with DirectorySlash On

We have a VM running with our hosting provider where the following issue occurs... When accessing https://www.app.com/folder-on-filesystem Apache sends a redirect (301) to the URL with a trailing ...
1
vote
1answer
1k views

EC2 with elastic IP & Route53 DNS - Domain is resolving to incorrect public DNS

Newbie here, please let me know if I can add any more details or if I'm missing something entirely obvious. I got my site up and running on an EC2 and I was able to view it with the public DNS. I ...
0
votes
1answer
946 views

How to redirect full url to subdomain?

I am trying to redirect a site page to a subdomain (same url) with .htaccess but it's stuck in a redirect loop or redirected to 404 page. The following is my code used in .htaccess: RewriteRule ^uk....
0
votes
1answer
210 views

Make root domain 301 redirect to A while specific page redirects to B in nginx

I'm using nginx and I have a domain that redirects to a specific URL like so: server { listen 80; listen [::]:80; server_name example.com www.example.com; return 301 http://example.net/page/example; }...
1
vote
1answer
608 views

Nginx: non-www site inaccessible via SSL (connection refused)

I'm trying to get a site secured with SSL, using nginx on Ubuntu 14.04. Here's what my server block file looks like: server { listen 80; listen [::]:80; server_name example.com www....
0
votes
0answers
410 views

NGINX redirect accesses by IP to access by domain name dont work

Every time instead domain browser in address line display ip address of server. Please let me know how can I redirect it to my domain? I have following setting, but dont work. upstream app { ...
3
votes
1answer
2k views

How can Nginx force browsers to disable or flush the redirect cache?

We have the following secure site. If the user opens http://name.tld, he should be redirected to https://name.tld. We initially messed up the order of the domains in the secure site, so http://name....
0
votes
2answers
957 views

nginx https domain redirection does not work

I know there are many questions around this topic, but I could not find the answer for my situation. So, basically, I have a domain - let's say myserver.com - and I want a subdomain to use for ...
0
votes
1answer
30 views

Migrating an HTTPS-website to another domain name on a single IP

I am running a website using HTTPS protocol (nginx webserver). Now I would like to migrate it to a new domain name. I did it multiple times while using HTTP. However with HTTPS it would be different, ...
1
vote
1answer
105 views

nginx - 301 redirect /subfolder1/some-friendly-url-12345 to /subfolder2/some-friendly-url

I'm a newbie on nginx. I have some old url's like /aaaaa/some-friendly-url-12345 and I want to 301 redirect these url's to new one but without ID's, like /bbbbb/some-friendly-url. I also want to ...
2
votes
1answer
2k views

How to respond to http health check at a particular url while redirecting other traffics?

Background: I am trying to set up an instance group in Google cloud platform. The instance group consists a number of nginx instances whose job is simply to redirect incoming https traffic to an ...
1
vote
2answers
5k views

nginx rewrite from www to non-www

My nginx file doesn't file is failing and I'm not sure how. I have managed to redirect from http to https fine. But I can't get the www to redirect to non-www version. What am I doing wrong? server { ...
1
vote
1answer
530 views

Redirect many domains to different locations of other domain with nginx without having to define many server blocks

Say i have multiple variations on a domain name, one brandname registered at multiple top-level domains; and they all need to go to one specific domain + append a dedicated custom uri that relates to ...
-1
votes
1answer
4k views

Nginx still redirects even though I removed the rule from the conf

I was using this block for redirecting the website's IP to the actual URL: # IP to domain redirect server { # tell on which port this server listens listen [::]:80; listen 80; ...
0
votes
1answer
356 views

Using Apache RedirectPermanent to send all requests to a specific subfolder

Having asked a long and convoluted question earlier, I now have some code here using RedirectPermanent that I need help with. We're merging an old site into the new one, and don't care about mapping ...
-2
votes
1answer
425 views

Apache persists on not wanting to redirect to https

I know many people have ask similar not to say the same question before: How can I redirect http to https (Using Apache)?/Why does it not do so? There is even a "code" snippet on the Wikipedia page ...
1
vote
2answers
3k views

Trying to redirect with and without trailing slash

I have moved a blog to a subdomain and on the subdomain all the categories have changed so I want to do a list of 301 re-directs from old domain to subdomain (different hosting). The problem I am ...
0
votes
1answer
767 views

Combining Apache ServerAlias and 301 Redirects

I've referenced this question but I'm not sure if I'm clear on how this works given this situation: I have a client with two brands that are currently online like this: Brand A (site 1) Brand B (...