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.

Filter by
Sorted by
Tagged with
0
votes
0answers
32 views

Is there a way to add an redirect exception to .htaccess for illegal characters in url? [on hold]

Is there a way to create a redirect exception to my .htacess for illegal characters in url (example: empty spaces). I already redirect all traffic to https except for two dynamically generated urls, ...
3
votes
1answer
62 views

Redirect all URLs from http to https (with 301 ) except for a few [duplicate]

I am trying to 301 redirect all URLs from http:// to https://, using .htaccess. Some dynamically generated URLs should be excluded. Example of some URLs I do not want to redirect: example.com/tt....
0
votes
0answers
22 views

Redirect old domain to new domain with different URL structure NGINX

As the title says I want to redirect a domain to another domain with different URL structure. for example, domain A have URL like this domainA.com/files/ghgjhgjhgytuyjghjhhg Domain B has the same ...
0
votes
2answers
157 views

Apache rewrite breaks when https site's url sub-directory is explicitly specified over http

I have been struggling with a silly issue, and I am sure someone has already asked this but I could not locate the correct response here or elsewhere. So here I go. I've set my .htaccess file to ...
0
votes
0answers
76 views

Cloudflare page rules for redirecting root domain to www subdomain

I'm not sure about this question fits here. I wonder how can I redirect a root domain to a www subdomain. I tried adding these. (If the URL matches: example.com, Then the settings are: Forwarding ...
0
votes
0answers
10 views

Multiple files for apache RewriteMap

I currently have this (2 files with redirects, same rules for both) RewriteMap test "txt:/tmp/redirects.txt" RewriteCond %{REQUEST_URI} ^(.*)$ RewriteCond ${test:%1|NOT_PRESENT} !...
0
votes
0answers
46 views

Redirect from www to non-www not working in Nginx

I'm having trouble redirecting from www to non-www for one of my domain names. In the past I have used a similar (read identical) configuration and it just worked. Somehow this doesn't work however. ...
0
votes
2answers
88 views

Is it wise to have fail2ban block 301 brute forces when you have http to https redirection enabled?

Recently my servers started getting bombarded by anonymous scanners/brute forces. This is how my nginx access.log looked like after the attacks : xxx.xxx.xxx.xxx - - [07/Sep/2019:23:30:16 +0200] "...
1
vote
1answer
49 views

htaccess 301 redirection with 500 error with “?” in URL

I'm trying to redirect some URLs internally. From: https://example.com/?cat=123 To https://example.com/?cat=456 In .htaccess file I wrote: <IfModule mod_rewrite.c> RewriteRule ^?cat=123$ ...
0
votes
0answers
35 views

Nginx catch all and catch all redirect causes binary download

I have server which must serve only HTTPS, and I can have domains or subdomains created dynamically by users and be handled by application itself. I tried to use return and redirect but when ...
1
vote
1answer
101 views

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

I am facing the similar issue as described here: How to stop nginx 301 auto redirect when trailing slash is not in URI? Yet in my case the confifuration is a little bit different. I am using the ...
0
votes
0answers
22 views

nginx ip address not redirecting to domain

I have set up a http -> https redirect like so, however, it is not redirecting http://ipaddress:5000 to https://subdomain.mydomain.com # HTTP — redirect all traffic to HTTPS server { listen ...
0
votes
1answer
53 views

How to remove the “301 Moved Permanently” text that shows up on the client side?

How do you remove the following text: 301 Moved Permanently. The document has been permanently moved. that shows up on our web site's home page? I have used a web crawler to identify what links ...
0
votes
0answers
23 views

Nginx redirect on folder request but allow subfolders of that folder to pass

I have the following Nginx config which i want it to apply 2 rules. Rule 1 When the URL request contains the subdirectory /shop to be 301 redirected to the frontpage of the website. For example: ...
0
votes
0answers
15 views

Access source url in 301 redirect Nginx and javascript

I have two domains www.abc.com and www.pqr.com . I want to redirect the user from "www.abc.com" to "www.pqr.com" for all requests. Redirection is working fine. I want to display a ...
0
votes
0answers
34 views

How to redirect from https to http in a specific nginx location block for a URL

this question does not duplicate of this link My application is web based and developed in django, deployed through UWSGI application server with nginx as a reverse proxy. The task is to redirect ...
0
votes
1answer
36 views

apache redirect everything except certain paths

Brand new to apache, using 2.4 in this case, trying to get a redirect rule to work such that everything on port 80 is redirected to 443, except certain routes. This rule keeps redirecting everything ...
-1
votes
2answers
72 views

Apche http mod_rewrite and HTTPS [closed]

I have two domains old.example and new.example. I want to redirect old.example to new.example sending a 301 response code and forcing to use https. All works fine using HTTP, but it fails with HTTPS....
1
vote
1answer
79 views

Why is 301 Redirect Not Working After Removing .PHP Extension via HTACCESS?

I'm removing the .php extension from files contained within a specific directory on my website (courses) via .htaccess on Apache/2.2.26 (Unix). Additionally, I'd like to 301 redirect the old .php ...
1
vote
1answer
62 views

Nginx automatically adds wildcard to redirects

I am making some redirects with nginx, but for some it automatically matches everything at the end of the URL, which creates redirects to the wrong pages. I have these two redirects. location /en/...
1
vote
1answer
73 views

HTTP redirect (301, 302) with HSTS/.dev domain

I own a .dev domain, which is included on the HSTS preload list. The domain is registered with Namecheap. Now, when trying to set up redirects (301,302) from my www. to non-www, this is apparently ...
3
votes
3answers
243 views

Redirecting from https to http?

Strange problem here. I use FullCalendar to initiate an ajax request to an endpoint on my server. Endpoint is: https://my_website/events/?start=2019-03-31&end=2019-05-12&_=1555698739056 ...
0
votes
1answer
60 views

How to redirect one route from a domain some where else in apache

I have what, from my searching so far, seems to be a slightly different problem with site redirections than the norm. I need to redirect one particular route from one domain to another on a different ...
0
votes
0answers
63 views

nginx won't listen on non-standard port

My organization has a server that is just for handling redirects of retired sites (redirects-myorg.org). We've just retired a website (widgets.org), and I am adding the retired site to our redirects ...
0
votes
0answers
20 views

Different redirects for a subdirectory and second level subdirectories in nginx

I am not really experienced in nginx configuration but have a very specific problem. Our website has a blog on a subdomain - blog.example.com and we want example.com/blog to redirect to this subdomain....
-2
votes
2answers
22 views

How can I redirect all web requests to a specific subdomain on Nginx?

I have a website that I only want to serve requests at: abc.mywebsite.com I want any requests to: www.mywebsite.com mywebsite.com <anything that is not abc>.mywebsite.com to be directed to ...
0
votes
1answer
114 views

SSL Certbot in a domain with 301 redirect and nginx [closed]

I have one server at home working with a dynamic domain (mydomain.ddns.net) through my OpenWRT router. Now I want to host a web and I have bought a domain (www.mynewdomain.com) in GoDaddy and I have ...
0
votes
0answers
16 views

Folder 301 redirection [duplicate]

i can't redirect correctly an url path in htaccess Problem: https://www.example.com/folder1/folder2/folder3/ needs to rewrite in: https://www.example.com/folder1/FOLDER/folder3/ I tried many ways ...
2
votes
1answer
153 views

nginx try_files issuing http redirect beind load balancer; need https [duplicate]

My nginx instance is behind a SSL terminated load balancer, and I want all urls to hit https endpoints, which means http to be redirected to https. All is well when urls have a trailing slash. They ...
0
votes
1answer
195 views

Why is IIS 8 redirecting all HTTP requests to HTTPS?

I have a fresh install of Windows Server 2012 R2 with IIS 8 installed and all fully patched. I have created a new web site with a single page called home.htm and the site has an HTTP binding on port ...
0
votes
0answers
18 views

301 redirect configuration in apache2

I have an apache2 running on an Odroid XU4, and I've managed to configure port redirects, Dynamic DNS and HTTPS using LetsEncrypt. Right now I'm using a DDNS domain from a free service (xxx.ddnss.de),...
1
vote
0answers
27 views

AWS S3 + Route53: Always redirect to www prefixed domain [duplicate]

I have a domain: example.com. I've created an A record for www.example.com with an alias targeting the load balancer’s DNS; this works just fine for www.example.com. Now, I want to redirect all ...
0
votes
1answer
664 views

Redirecting HTTPS

We built a site for a client to advertise a new block of apartments they had built. The apartments have now all been sold so we have been asked to forward the domain to another domain until there is ...
0
votes
1answer
69 views

.htaccess throw 404 and then 301 on nonexistent path

Currently I have this set up in my .httaccess RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !\.(php|html|txt|js|css|png|jpe?g|gif|svg|woff|ico|csv|xml|pdf|gzip) RewriteCond %{...
1
vote
1answer
113 views

Virtual hosts on Apache not applying 301 redirect

I have a Ubuntu 18.04 server on an Amazon EC2 instance running Apache 2, with an SSL certificate installed, which I use exclusively to host virtual hosts for .tld variations of the policymakr.com ...
0
votes
0answers
94 views

Nginx redirect multiple query string urls

I want to redirect some URL to another folder on the same website. Each URL have query string so simple 301 return is not working. Example of redirect I want. example.com/th/?n=abc 301 to example....
0
votes
0answers
106 views

URL redirection and ACL conditions in Haproxy

I would like to check and compare the maxconn and conn_cur in haproxy. If the conn_cur value greater than maxconn, the url needs to be redirected. URL redirection is working, but the maxconn & ...
1
vote
1answer
153 views

How to debug big redirect chain in nginx. Unexpected redirect

I have a task to make a large site migration now. And i have a large number of redirects in config. But I cannot understand why one redirect causing second redirect in chain. Even if any other ...
0
votes
1answer
134 views

nginx server configuration to redirect all requests to ssl without subdomain

I want to redirect all requests to example.org. I created a configuration file as below. I can redirect the requests from : http anything.example.org to https example.org https anything.example.org ...
0
votes
0answers
239 views

Nginx Redirect Loop in a Letsencrypt Docker with Multiple Sites

I am getting a "too many redirect error" when I try to go to my own websites. Those websites are hosted on my server with Nginx inside a Letsencrypt Docker(Docker Hub: https://hub.docker.com/r/...
0
votes
1answer
78 views

NGINX: Cannot config nginx to handle redirect from HTTP to HTTPS redirect not working

I have try to config nginx: /etc/nginx/nginx.conf server { listen 80 default_server; listen [::]:80 default_server; server_name 10.0.0.10; #This is my private IP return 301 https://$...
0
votes
0answers
42 views

Apache HSTS with non-www to www 301 redirect

Just been setting up HSTS on an Apache vHost (it is a virtualmin box) and have that working, however I am experiencing strange behavior when trying to force a call to https www rather than it ...
0
votes
1answer
227 views

SSL Certificate, Redirect, No-www done right (apache)?

MY GOAL I would like to make a website accessible only via SSL (encrypted) and with many domains redirecting to only one master domain (no duplicate content) and all www variants should be no-www. ...
1
vote
0answers
141 views

Removing nginx server_name results in too many redirects

I'm trying to test out a new website before replacing the original one, since I don't want to impact users. I have an existing website at say example.com and am working on a separate WordPress site ...
0
votes
1answer
397 views

NGINX SSL “ERR_TOO_MANY_REDIRECTS”

I have website build with django and nginx. After adding Let's Encrypt SSL certificat using Certbot I get the error : ERR_TOO_MANY_REDIRECTS. Please find the below nginx configuration : server { ...
1
vote
1answer
324 views

Mapping Old to new URL is not working in Nginx

I am moving my old Url's to the new one (it is more than 50) so I have placed the URLs in a file but the redirection is not happening. map_hash_max_size 262144; map_hash_bucket_size 262144; map $uri ...
1
vote
1answer
708 views

Editable URL Rewrite Map for CloudFront/S3 Website using Lambda@Edge

I'm migrating a static website from IIS to Amazon S3, using CloudFront for https. The old site used the URL Rewrite module and had 301 redirect maps with over 200 entries. Here is an example: example....
0
votes
1answer
105 views

Redirect with space character for file download

I have this in the .htaccess file: Redirect 301 /product-installer https://download.testsite.com/installers/My%20Product%20v3.0.0.0.exe It's working correctly of Firefox as when you click the URL ...
2
votes
1answer
737 views

301 Redirect all child pages to parent page with the exception of a few child pages to other pages throughout the site

How would I go about 301 Redirecting all child pages to the parent page with the exception of a few child pages 301 Redirected to other specific pages throughout my site. Below works for redirecting ...
0
votes
1answer
192 views

Nginx HTTPS redirect loop with multiple domains

I know that there are other questions with similar topics, but I can't find a solution anywhere that solves my specific problem. The difference here is multiple domains with different sites. I have ...