Questions tagged [redirect]
HTTP or HTML mechanisms used for redirecting browsers to where the actual content is located
2,303
questions
1
vote
1
answer
1k
views
How do I redirect a URL with special (%C2%A0) characters in Nginx
I found out that I have link to one of URLs with some garbage behind that would generate some traffic, however whoever it placed it did it wrong:
/domain/sub-directory/%C2%A0
Therefore, I would like ...
0
votes
1
answer
606
views
Apache, redirect for a moved directory
On our webserver a directory has been "copied" from one location to another. Now the original location is gone however I am receiving requests to provide a redirect to the new location.
I ...
0
votes
1
answer
231
views
apache2 is directing to wrong path when using https for sub domains
I have an ssl wildcard cert (letsencrypt) for example.de & *.example.com.
My 000-default.conf looks like:
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname ...
0
votes
1
answer
602
views
Avoid duplication in nginx redirects config?
Setting up redirects www → non-www and HTTP → HTTPS at the same time, I ran into duplication issue that I fail to overcome.
On my domain—let it be example.com—I have a website with primary name ...
0
votes
0
answers
261
views
Proxy Redirect on NGINX not working as expected
I set up nginx as a reverse proxy for two proxied servers. Each of them (proxy and proxied servers) is running as a container in a docker environment. Proxied server appalpha is simply an nginx:alpine ...
1
vote
0
answers
274
views
HAPROXY - redirect URL and keep the same URI
Im using haproxy to do redirections. Basically I have a URL ( https://google.com// ) and I want to keep the same URI and just redirect only the base url ( https://test.com//). For HAPROXY it has to be ...
0
votes
1
answer
533
views
Nginx too many redirects error when using upstreams
I have the following nginx config
upstream test1 {
server 10.0.1.8:33284;
server 10.0.3.9:32783;
}
server {
listen 80;
server_name test1.example.com;
rewrite ^ https://test....
0
votes
1
answer
193
views
How to solve non-www redirection to www Nginx?
This is my NGinx Web Server configuration
server {
if ($host ~ ^[^.]+\.betafox\.net$) {
return 301 https://$host$request_uri;
} # managed by Certbot
...
1
vote
1
answer
814
views
Two different rewrite conditions in the same .htaccess?
I need to create a rewrite condition for two specific files, according to the requested path in the URL. It's possible?
Condition 1: If the URL is example.com/admin go to admin.php?uri=params. That is:...
0
votes
2
answers
235
views
Redirect URL path to an action on index?
I'm running an apache web server on Ubuntu 20.04.
I have a domain.com which directs clients to the index.html. On the website there is a button that, when clicked, opens a calendal pop-up widget. I ...
1
vote
1
answer
3k
views
Best way to redirect root domain ("apex domain") to another location
This question is a continuation of Using Route53 to point apex/root domain to Heroku application
Right now I have my domain abc.com registered with Route53. I am using a ddns service to point it to a ...
1
vote
1
answer
429
views
How to remove ".com" suffix from hostname variable using .htaccess
I'm attempting to create a unique series of redirects on an Apache web server (Server version: Apache/2.2.15). Using .htaccess or additional Apache modules, I need to fully parse requested URLs in ...
0
votes
1
answer
4k
views
iptables NAT REDIRECT
I have a server that is receiving syslog traffic. Many of my devices can only send to the default udp/514 port. My syslog server can't run on ports <1024 and is running on 5000. I have a nat ...
-1
votes
1
answer
171
views
How to direct a custom domain at a particular tweet [closed]
I have registered a new domain, let's call it particulartweet.com.
I would like users who enter that domain in their browser to land on a particular Twitter URL, like https://twitter.com/wgervais/...
0
votes
0
answers
137
views
Nginx prevent hotlinking and redirect not work with new Nginx version
In the past, this works perfectly:
#domain1.com
location /files/ {
valid_referers none blocked domain1.com domain2.com domain3.com;
if ($invalid_referer) {
return 403;
}
if (!-...
1
vote
0
answers
43
views
nginx - how to functionally achieve an "internal 307 redirect" [duplicate]
I'm not sure how to describe the functionality I'm trying to achieve in a way other than "an internal 307 redirect".
Using nginx's error_page directive causes nginx to change POST requests ...
0
votes
1
answer
2k
views
How to redirect forward from one subdomain to another subdomain with DNS?
I have several subdomains under an existing main domain, e.g.:
eg.domain1.com
ie.domain1.com
The company is rebranding, and has setup a new main domain, under which all of these subdomains now need ...
0
votes
1
answer
595
views
Mobile redirect in nginx with query string
I'm trying to redirect mobile visitors to AMP pages with nginx.
I've basically using the script @ https://gist.github.com/dangayle/2919206 with recommended modifications, plus elements from the answer ...
0
votes
1
answer
747
views
Apache2 : 2 php versions in the same VHOST
I am migrating my app from PHP 5.6 to php 8.0 by having a front controller redirecting to my legacy app or my new app depending on the uri.
I tried with alias and it works but I need to keep the exact ...
0
votes
0
answers
251
views
AWS S3 static website: unable to access https://mydomain.tld but http://mydomain.tld redirects to https correctly
I've set up a static website on AWS S3, using a custom domain hosted at Namecheap, and Cloudfront serving over https. I am able to access my site at http://mydomain.tld, which redirects (using a DNS ...
1
vote
1
answer
2k
views
Rewrite Rule for URL with query does not work
I write the following rewrite rule:
<IfModule mod_rewrite.c>
RewriteCond %{QUERY_STRING} rp=\/knowledgebase\/.*
RewriteRule ^\/customer\/index.php /knowledgebase/ [R=301,L]
RewriteRule ^\/...
0
votes
0
answers
1k
views
421 Misdirected Request error when loading my myurl that redirects to subdomain m.myurl
When refreshing, it eventually loads.
The background is,
I have a main domain, and two subdomains, blog.myurl and m.myurl
The blog. is hosting blogger page with its own SSL
The main domain and the m....
6
votes
1
answer
4k
views
AWS: How to redirect many domains to a page on another domain?
My objective
I have a number of domains (e.g. 10 or 20) and I would like to redirect any visitors to anywhere on those pages to one page on another domain (for example my stackoverflow.com profile ...
0
votes
1
answer
428
views
iptables doesn't redirect 443 to 8443 on local machine
I want to redirect all the traffic from my computer from port 443 to port 8443. All the traffic is on the same machine. A proxy server is listening to port 8443 and i tried to add the following Rule:
...
1
vote
0
answers
599
views
Nginx rewrite and return interfere with different location block
I have the following configuration in nginx for redirecting in a certain scenario.
location /prefix-someurl {
if (condition) {
return 301 $scheme://$host/xyz.html;
}
proxy_pass ...
1
vote
1
answer
1k
views
Redirect secure domain to another via CNAME and an Nginx Docker Container
Update: I have appended a 2nd attempt at the bottom of this post. It is "working," but I would like to make my original idea work.
I am attempting to redirect an https request for a domain ...
0
votes
1
answer
2k
views
Nginx rewrite urls within a single page app
I've been having issues with this nginx configuration, and after scouring this site, I'm wondering if it's even possible.
I have a very simple single page app with the following routing:
server {
...
0
votes
0
answers
55
views
Nginx proxy using domain as part of url path
I'd like to proxy foo.domain.com to the internal server http://localhost:8080/foo, the subdomain part is dynamic so bar.domain.com is also proxy to http://localhost:8080/bar.
I try this code up and ...
0
votes
0
answers
119
views
Nginx redirect rule to sub-directory
I have an old PHP application running with Apache, for now I need to switch to use Nginx
htaccess redirecting rule
php_value upload_max_filesize "5M"
AddType text/x-component .htc
...
0
votes
0
answers
77
views
Extra trailing slash when re-directing www to non-www
This is my current configuration:
server {
if ($host = www.mywebsite.com) {
return 301 https://mywebsite.com$request_uri;
} # managed by Certbot
if ($host = mywebsite.com) {
...
2
votes
1
answer
764
views
used colons for url htaccess http://localhost/1:1
I have a problem with the colons used in url
this my url
http://localhost/1:1
this my htaccess
RewriteEngine On
RewriteRule ^/(.*):(.*) index.php/$1:$2
this error show Forbidden You don't have ...
2
votes
1
answer
635
views
Too many redirected error with Nginx on PHP
I have 2 node apps running on different ports and a PHP app. When I visit the node apps I get no errors but if I try to go to the PHP app (on /sourcebans) I get This site redirected you too many times ...
4
votes
1
answer
3k
views
Have nginx redirect everything to https except one directory
I need nginx to redirect all http URLs to https, with the exception a ".secret/" directory which should continue to be served as http.
So, for example:
http://example.com/a.html --> ...
1
vote
1
answer
70
views
nginx - 301 redirect wrong URLs used on extern website
For some reason, some extern websites have links to my website subdomain.example.com looking something like this: <a href="https://subdomain.example.com/https://subdomain.example.com/index.php?...
1
vote
1
answer
654
views
Nginx disable https redirect for 404+http uri
I have HTTPS redirect in nginx.conf
But if the requested URI is HTTP and 404 - I don't need a redirect.
Is there any solution for this specific configuration?
Also is there a possibility to turn off ...
1
vote
1
answer
1k
views
Redirecting Error with google load balancer
I'm trying to setup Google Load Balancer and couldn't get it work. It produces either 502 or 302 error.
Wanting to direct www to non-www, http to https.
This is my rewrite rule
SetEnvIf X-...
1
vote
1
answer
328
views
Nginx + Wordpress language redirect wrong with default language
Nginx + Wordpress language redirect wrong with default language
Sorry for duplicate this questions here:
Nginx + Wordpress language redirect
All works but for the default EN language.
I just want to ...
0
votes
0
answers
86
views
HTTP redirect not working
My website: https://www.louiswebsdale.co.uk/ keeps giving the "400 bad request invalid header" error when trying to visit it without the https. So www.louiswebsdale.co.uk or http://www....
0
votes
0
answers
25
views
How do I ensure that website (a react webapp) can only be accessed as a redirection from another website, and not directly
I am running a SAAS company that is websited at www.mycompany.com, and I have a business-partner that is websited at www.mypartner.com. I'd like to redirect a user which is logged-in to www.mypartner....
0
votes
1
answer
639
views
How to set up conditional redirects on an Application Load Balancer for an Elastic Beanstalk environment?
I have two Docker-based single-instance Elastic Beanstalk environments (one for staging and one for production).
I'd like to migrate the (Elastic Beanstalk) application to sit behind a load balancer (...
1
vote
0
answers
657
views
how to make a redirect conditional on nginx conf
I should make a conditional rediction in nginx.
I would like to do something like that.
$http_code = code from curl commande
if ( $http_code = 200 ){
"redirection to server 1"
}
else {
"...
1
vote
1
answer
997
views
Redirect url to the CDN storage
I have structure folders on my nginx server:
Image URL
https://example.com/wp-content/uploads/image.jpg
https://example.com/wp-content/uploads/WP-data/data/employees/per-005/9032.jpg
I want it ...
0
votes
2
answers
539
views
Distributing load over multiple load balancers
Given a website that could have many hundreds of thousands of concurrent users at peak times how can one manage the laod where load balancer resources can only support 40,000 concurrent connections? (...
0
votes
0
answers
851
views
NGINX - subdomain using https to another internal IP:PORT and hide new path
I have spent more than week looking around this site to solve the following two items.
Background: subdomains are setup in GoDaddy DNS to forward to our public IP.
Internally DNS has forward and ...
1
vote
1
answer
7k
views
How do you redirect URLs with a query string with htaccess?
I want to redirect pages like :
example.com/fr/opportunites/?sector_cat=bourses-detudes&ajax_filter=true
To
example.com/fr/bourses-detudes/
the second page is a post type page created with ...
0
votes
2
answers
174
views
Need assistance to rewrite url in Nginx for WHMPRESS
I need to rewrite URLs in NGINX. I tried many examples from google searches but failed.
/manager/?whmpca=order_process&a=add&pid=5&a=add¤cy=1&billingcycle=monthly
I need to ...
0
votes
0
answers
81
views
Regex on htaccess file gives INTERNAL REDIRECT error
I'm trying to create a redirect rule that matches the following urls:
en/property/rotterdam/apartment/lorem-ipsum-dolor-sit-amet/v-9/
en/property/rotterdam/apartment/lorem-ipsum-dolor-sit-amet/9/
en/...
2
votes
3
answers
7k
views
Nginx: Rewrite while preserving the path
I want to set up a temporary redirect to another domain but I want to keep the path very similar.
Here's an example:
Request URL: https://api.mydomain.com/uploads/default/logo.png
Rewritten URL should ...
0
votes
1
answer
143
views
Why "/" nginx location rule fails to catch some URLs? Isn't it supposed to go with all?
I have an nginx that serves as reverse proxy, and it redirects requests to an angular app or to a node js backend app depending on the request URL. There is also a rule location ~ /s/(cas)/(.*) that ...
1
vote
0
answers
449
views
Nginx redirect wp-admin in root to wp-admin in subfolder
I'm running a multisite in subfolders to facilitate multiple languages.
My hosting provider uses the following Nginx config to fix the /wp-admin/ directives for the multisite environment:
if (!-e $...