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.

0
votes
1answer
760 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 (...
1
vote
1answer
381 views

Server hacked, 301 redirect, domain lost?

My Ubuntu 16.04 with a new, up to date Wordpress installation (with only one or two Plugins) was hacked. I initiated a new server installation to get rid of anything bad. It seems like nothing really ...
0
votes
0answers
15 views

redirect rule for http://www.example.com/http://www.example.com [duplicate]

Checking web master tools I've found a third party has incorrectly linked to my site with a url following this pattern: http://www.example.com/http://www.example.com I added in a rule to my htaccess ...
1
vote
0answers
579 views

ELB, Nginx and redirecting http to https - 408 requests timeout

I have this configuration: The Amazon Elastic Load Balancer (ELB) routes port 80 to port 81 and port 443 to port 80 The cert is handled in ELB Nginx listens to port 80 and 81 Port 81 redirects to ...
1
vote
3answers
647 views

Nginx redirect from http www to https non-www

I'm trying to redirect http://www.example.com to in Nginx. Only non-www version has a certificate installed. I have two 301 redirection rules in that order: 1) From http://example.com to server { ...
0
votes
1answer
227 views

Nginx - Redirect the rest of the alias domains to a main one in OpenShift

I'm trying to redirect permanently a couple of alias domains of an application in OpenShift to a main one for SEO purposes. The application is running a working instance of Openshift Nginx Cartridge. ...
2
votes
4answers
634 views

nginx downloads empty file when requested on port 80 (instead of redirecting to port 443)

my nginx webserver does not do, what he should. All http:// requests to the server should be redirected with http 301 to https://, it worked fine for the last few days, until it stopped working ...
1
vote
1answer
119 views

.htaccess Redirect issues

This is what I need to do. Redirect sub1.domain1.co.uk to sub2.domain2.com Redirect sub2.domain2.com to sub2.domain2.com/sub-folder These both work BUT this doesn't: Navigating directly to sub1....
1
vote
0answers
466 views

HTTP/1.1 301 Moved Permanently from the IIS for two minutes

The IIS for two minutes was redirecting from www.exaple.com to www.example.com. Nobody fixed it - it was a temporary fault. There is URL Rewrite 2.0 installed which has one rule which was not ...
0
votes
1answer
577 views

Best way configure 301 redirect forcing https:// no-www on a Serverpilot (nginx/apache server)

Current Situation: I have succesfully managed to manualy set up an SSL certificate on my Serverpilot (nginx/apache) server. Because my website runs on a Serverpilot server, it is partly nginx, partly ...
1
vote
0answers
471 views

apache2 misconfiguration, appends infinite /index.html/ to url

I use the bash under Windows 10 with apache2 and php7 installed. I set up a vhost for http://localhost mapped to a symbolic file which is linked to a physical windows directory. When I open the url, ...
1
vote
1answer
32 views

redirecting a subdirectory to some other hosting server fluently [closed]

I am hosting a server on which I would like to have a /articles folder. I would like to redirect all calls to this name www.myserver.com/articles to a wordpress that is being hosted on another server. ...
0
votes
1answer
700 views

ServerAlias or Redirect

I have a site running at www.domainA.com and need this to be pointed to www.domainB.com/domainA www.domainB.com is running WordPress on Apache and we currently have a ServerName for domainB and ...
1
vote
2answers
768 views

Apache Rewrite Rule on Dispatcher

How can I do a rewrite rule for both http://example.com/abc to rewrite/redirect to http://example.com/abc.html but it should work when I have the URL as http://example.com/abc/def.html. Currently when ...
0
votes
1answer
513 views

Redirect all URLs without .html and set status code 301

I'm struggling wit a configuration for nginx. I have to add the .htmlsuffix to all URLs, which don't have it and do a 301 redirect to the same URL with the suffix. URLs which have the .htmlsuffix ...
0
votes
2answers
2k views

If else condition Apache 301 redirect

I have multiple URL's that looks something like this : stage-app-platform-com.something.com stage.something.com stage1.something1.com I wanted to create an Apache 301 redirect rule which, if the URL ...
0
votes
1answer
56 views

NGinx redirect rule

i need to redirect specific paths on nginx but cannot find the way :) In particular redirect 301 this urls http://www.domain.com/c/Integratori-di-Proteine/Universal-.html http://www.domain.com/c/...
1
vote
2answers
2k views

.htaccess 301 redirect for URL ignoring its parameters

File redirects Redirect 301 /products.php http://domain1.com/product_123.php and domain redirects Redirect 301 / http://www.domain2.com/ are easy. However, I want to redirect some a URL ignoring ...
2
votes
1answer
1k views

Nginx as a proxy for Apache server running WordPress

I am facing a similar problem as this question where I am using Nginx as a proxy for Apache server (Ubuntu) running WordPress. The internal links of the website all give 301 redirects to localhost. ...
0
votes
1answer
356 views

Redirecting via 301 subdomain to URI/URL configuration error in NGINX

Trying to get a simple subdomain redirect in NGINX to a URI/URL path. At this point I want to get nginx.somedomain.com to redirect permanently to nginx.somedomain.com/sample/redirection.html. The ...
0
votes
0answers
416 views

Use RegEx to redirect all of website EXCEPT one URL

I've been directed here by support at WPengine, but I'm not sure whether this question should be asked here or over on Overflow... I'm using RegEx to redirect all paths and pages of a sub-domain to ...
0
votes
1answer
34 views

Is there a way of writing cleaner rewrite rules if you've a large number of redirects to implement

I recentley completed a project whereby I moved a pretty large website to a nice clean smaller website. What this meant was I had to account for a large number of pages that had been indexed by search ...
-1
votes
1answer
690 views

Redirect old domain to new domain with full path

I've very little knowledge in this area - hence the question... I'm looking to do the following: I currently have a server with a number of websites listed in sites-available and sites-enabled. There ...
1
vote
1answer
826 views

add a URL suffix path (for mobile AMP) without causing a redirect loop in nginx

i am using nginx web server for my wordpress website. i am going to make it to become amp version for mobile serve. i wanna add /amp/ to my url. i also using pretty permalink for my current url,so ...
0
votes
1answer
93 views

Nginx Redirect depending upon user input with POST requests

I have two Data centers and within each there are multiple servers and database servers. These servers are hosting specific of some company ID's. I want to redirect my users depending upon the ...
1
vote
0answers
281 views

redirect subdomain of old domain to directory in new domain

I would like to redirect a subdomain of an old domain to a directory on a new domain. e.g. forum.old-domain.com should redirect to new-domain.com/forum The redirection from old-domain.com to www.new-...
1
vote
1answer
351 views

.htaccess 301 redirect does not work

I have a website using PHP-based CMS system. So each page is generated dynamically, like this : http://www.shuling.net.cn/index.php?_m=mod_product&_a=view&p_id=87 Now I want to redirect ...
0
votes
1answer
59 views

Use haproxy to redirect *.domain1.com/* to *.domain2.com/*

I am struggling with some HAproxy rules for a while with no luck unfortunately. Let's say I have domain1.com and domain2.com. I want to redirect everything from domain1.com to domain2.com, including ...
1
vote
1answer
242 views

301 redirect custom link

I have few thousands link like this /Gallery?cmd=viewCarGallery&carID=3747&pgID=1 Now I want to redirect them using .htaccess to another site to others link. Every will link will be redirect ...
1
vote
1answer
2k views

How to forward all http requests to https without breaking letsencrypt with nginx

I'm using Nginx to serve as a reverse proxy for Rstudio server and Shiny server for the purposes of securing the connection to these services. I'm using Letencrypt for free signed certs. I have this ...
0
votes
1answer
317 views

Excluding one URL from being redirected to HTTPS generates a loop with current NGINX version

I just updated my NGINX server on Ubuntu to the latest official version 1.9.15. Since then a config that I used for quite a while stopped working. In short, I redirect all traffic to https except ...
0
votes
2answers
89 views

Redirect path nginx with location

I want to implement multiple redirections, for example: I did this: location = /about { return 301 /es_CR; } And is correct but a need /about, /about-us and /about.php to redirect to the same ...
1
vote
1answer
825 views

Apache www to non-www redirect on Amazon Elastic Beanstalk

I've recently moved a simple PHP site to Elastic Beanstalk but am finding it difficult to redirect the www.example.com to example.com. It's not https which most of the suggestions I have found are ...
3
votes
0answers
50 views

301 Redirect to other domain of selected deep pages only?

would appreciate help on this i am trying to 301 selected deep pages only from one domain to deep pages on another domain. I do not wish to 301 the entire site. My questions are a) is this possible ...
0
votes
1answer
24 views

Separating Redirects from .htaccess

I'm migrating my server to a different location. I have a bunch of changed URL's (50 or so) that I need to 301 redirect to new locations. I use Apache 2.4 Is there a way to separate them from ....
2
votes
1answer
6k views

Haproxy 301 URL redirect on query string condition

Using Haproxy 1.5.12 running on Ubuntu 12.04 My website gets a lot of requests like this one: http://www.example.com/foo/bar/mypage.php?gallery=&position=3 the correct URL should be: http://...
0
votes
1answer
258 views

Nging redirect http and https to https://domain (without www)

This is my Nginx config: upstream app_server { # Bindings to the Gunicorn server server 127.0.0.1:8002 fail_timeout=0; } server { listen 80; server_name "~^www\.(.*)$"; return 301 https://$...
0
votes
1answer
99 views

nginx mutiple domain with ssl and www redirection

nginx redirection is not working as expected with ssl and www redirection. I have two domains say, domain1.com and domain2.com. I need to have https with www redirection on both ie https:/www.domain1....
1
vote
1answer
641 views

HTTP Redirect of Cyrillic URLs: this example works without URLs being encoded. Why?

As per the https://tools.ietf.org/html/rfc5987, HTTP header fields should be returned using the ISO-8859-1 character encoding. This applied also to the Location field used for the redirection. ...
0
votes
1answer
108 views

lighttpd rewrite in magento

I'm currently using below code in lighttpd.conf to redirect http to https. $HTTP["scheme"] == "http" { $HTTP["host"] =~ ".*" { url.redirect = (".*" => "https://%0$0") } } However, ...
1
vote
0answers
776 views

old URLs to new URLs using nginx

I need to: replace old SEO unfriendly URLs with new SEO friendly URLs e.g. replace http://../products/?type=genre.main.key&key=DAN&title=Dance&page=1 with http://../genres/dance?key=...
0
votes
1answer
720 views

How to send a permanent (301) redirect from HTTP to HTTPS in Jetty 9

After following the suggestion on How to have Jetty redirect http to https, we were able to get our standalone Jetty deployment to redirect all HTTP requests to HTTPS. The redirect however is a 302. ...
1
vote
1answer
1k views

NGINX: Check if SSL (HTTPS) is available, if not, redirect to HTTP

The current config is: server { listen 80 default_server; listen [::]:80 default_server; listen 443 ssl default_server; listen [::]:443 ssl default_server; listen 192.168.0.5:80 default_server;...
0
votes
1answer
499 views

nginx - redirect domain to a different domain and specific path with hash

I'm trying to go from mynewdomain.com to mytenantsite.com/tenant.html#store/home. I have tried variations of: server { listen 80; server_name *.mynewdomain.com; return 301 $scheme://...
6
votes
1answer
7k views

How to stop nginx 301 auto redirect when trailing slash is not in URI?

Every time I try foobar.com/test in browser, nginx seems to redirect (301) the client to foobar.com/test/. This behaviour is unacceptable. The proxied server is a remote Apache web server. I have ...
3
votes
0answers
59 views

Redirect user to an arbitrary application protocol (used by Android app)

I have an Android application that declares an intent using a in-house protocol. You can launch it by opening a webpage that contains a link to : myapplication://foo-bar I want to an URL on my ...
0
votes
1answer
65 views

301 or 302 redirect for site which will have no content for a year?

I have a domain which will not have any actual content for a year or maybe more, and I want to redirect for the time being. Should I opt for a 301 or 302 redirect? The site is for an academic research ...
0
votes
0answers
250 views

301 redirect entire domain to a single page .HTACCESS

First try: Chated for over 3 hours with an representative of one.com. Best advice they could gave me: do a metarefresh. Bummer. Second try: Options +FollowSymLinks RewriteEngine on RewriteRule (...
0
votes
1answer
2k views

Apache: Redirect everything from www to non-www using https only (including HSTS)

My goal Everything results in https://mydomain.tld (non-www and with TLS) and HSTS works correct. I am using the certificates from LE (Let's Encrypt) and so I used their wizard to make my website ...
0
votes
1answer
38 views

Add a path after / to http request in HAProxxy

I am currently redirecting my users from get.foo.com to foodownload.com, and then they can click and download bar.mp4. I want before redirecting, change the path, so by entering get.foo.com, their url ...