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
31 views

Test for no 404 error before enabling RedirectMatch?

I have a RedirectMatch to a remote server in my Apache httpd.conf file. However, sometimes the remote server gives a 404 HTTP response. Is there a way for the Apache server to ping the remote server ...
1
vote
1answer
21 views

Redirect French homepage (and only FR home page) to English home page

Using the .htaccess file, I would like to redirect www.example.com/fr/ to www.example.com/ but not other French pages that have the /fr/ root (e.g. www.example.com/fr/page-name) I've tried using ...
0
votes
0answers
41 views

Page redirection not working

RewriteEngine On RewriteCond %{HTTP_HOST} ^example.com RewriteRule (.*) https://www.example.com/$1 [R=301,L] with the help of the above code, I am able to redirect https://example.com/ to https://www....
1
vote
1answer
26 views

nginx redirect or return single location

I am trying to get videos.mydomain.com/kickboxing to redirect to a YouTube link, as well as videos.mydomain.com/classes to redirect to a different YouTube link. (These are both unlisted playlists, and ...
0
votes
1answer
37 views

Nginx puts browser into a redirect loop when using multiple server blocks

I'm using Nginx to host a number of virtual hosts (or server blocks in Nginx nomenclature). These hosts all share the same domain with each assigned its own subdomain. One subdomain enters an endless ...
0
votes
2answers
121 views

Why nginx "return 301" and ”try_files“ fall into an infinite loop

my conf code: index index.html index.php; location / { if ($uri = '/a/') { return 301 https://example.com/a; } try_files $uri $uri/ =404; } If url is /a/, 301 to /a, then ...
1
vote
0answers
27 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 ...
0
votes
0answers
14 views

apache: redirect only when url matches without query

I have this redirect RewriteRule ^on-the-yard/detail/?$ /on-the-yard/ [R=302,NE,L] and I would like to use it ONLY when the exact URL matches ^on-the-yard/detail/?$, but the problem I'm having is ...
1
vote
1answer
40 views

Ngnix redirect for multilevel subdirectories

I have URL like the following structure: xyz/asset.html abc/test.html xyz/abc/test.html xyz/abc/qwerty/test2.html I would like to redirect: xyz/asset.html to xyz/asset xyz/abc/test.html to xyz/abc/...
0
votes
0answers
19 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) { ...
4
votes
1answer
418 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
1answer
24 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?...
0
votes
0answers
29 views

Preventing redirects for file serving in apache

I am working with a specific proprietary (and no longer properly supporter) http client, and it has an issue of giving up on trying to download files if an http server throws a 301. I am using ...
0
votes
0answers
37 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
1answer
59 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
2answers
47 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&currency=1&billingcycle=monthly I need to ...
0
votes
0answers
56 views

How to reduce the redirect latency of Apache and WordPress?

I try to test the redirect of my server. I input the URL www.datanumen.com/sql-recovery in https://httpstatus.io/. Based on the result: Redirect from http to https is performed by Apache, latency is ...
0
votes
2answers
67 views

What is the reason for this falsely redirect to www.www2.example.de

I set up a testserver for our main website www.example.com. I set the apache-sites-config to www2.example.com. I deleted the .htaccess / adjusted it to hold the basic wordpress-entries. I disabled the ...
0
votes
0answers
17 views

nginx redirects do not show when browsing in Private Mode

I have domain1.com that needs to redirect to domain2.com. My nginx config under /etc/nginx/sites-enabled is this, server { listen 80; listen 443 ssl; ssl_certificate /etc/letsencrypt/live/...
1
vote
1answer
77 views

.htaccess redirect based on the visitors host name, not IP address

I have done several attempts to figure out how to redirect visitors from the visitors hostname to some other place. I know with IP this works: RewriteCond %{REMOTE_ADDR} ^185\.93\.180\.* [OR] ...
0
votes
1answer
92 views

HAProxy 301 Re-Direct non www to www for root domain

I am trying to setup HAProxy in a way that when a user goes to example.com, they are 301'ed to www.example.com, while keeping intact the users ability to go to sub1.example.com, sub2.example.com, etc, ...
0
votes
1answer
49 views

Apache Redirect with OR Operator

How can I use the Apache OR operator to redirect several paths to one URL? E.g.: RewriteEngine on RedirectMatch 301 /foo || /foo/bar || /das.html https://example.com/ext/ddy/$1 Thanks for any help.
1
vote
2answers
105 views

How do I correctly implement DNS and redirects from subdomain to domain

We are updating our website (example.co.uk) part of which involves setting up 301 redirects from the old site, in the .htaccess file — which is fine and straightforward. The old site had an area that ...
0
votes
1answer
118 views

Is it possible to reveal URLs in a masked, server-side 301 redirect?

I work for a search monitoring company and I'm currently investigating some advertisements which are hiding malicious URLs in masked, server-side redirects. When users click these ads, they're ...
0
votes
0answers
73 views

Can't find the source of my 301 redirect in IIS?

I have a production site www.mysite.com and a development site dev.mysite.com. The two sites are served from different folders and use different IIS configurations. When I browse the beta site, on its ...
1
vote
1answer
41 views

.htaccess Redirect 301 - Single pages work fine, homepage doesn't

I'm trying to redirect some specific pages to the new ones on my new site (these redirects work fine) and, finally, my homepage OR (even better) my homepage and all the pages which I didn't redirect ...
0
votes
1answer
41 views

IIS Simple redirect rule does not work

I'm changing forum software for my website. I would like to redirect the board URLs. For example, The old URLs are example.com/forum/genika/board1 and the new URLs are example.com/forum/boards/board1 ...
0
votes
0answers
16 views

HA Proxy URL Redirect

I am trying to redirect requests from http://example.com to http://anotherurl.com/create/ I have done the below configuration using loadblancer appliance. However, I run into connection timeout error. ...
1
vote
0answers
10 views

Public WordPress Website unaccessible from inside active directory with same domain name, but simple html file is accessible

a client uses the same corporate domain for his internal network / office365 installation as for the public website. The website and domain are hosted on a shared host, the site is serviced by me. ...
0
votes
1answer
45 views

Can't find 301 redirect source

I'm running two websites from a Raspberry Pi. Until recently it all worked very well. Then I moved house and now nothing works. I don't think the moving of the house is the issue for various reasons. ...
-3
votes
1answer
123 views

How redirect by .htaccess dynamic nested URL

How use write rule? I need to redirect www.example.com/accesories to www.example.com/accesories/item UPDATE: If I use Redirect /accesories /accesories/items I receive: www.example.com//accesories/...
1
vote
1answer
638 views

.htaccess multiple 301 redirects

I am moving a blog hosted on an Apache server to a new domain. The permalinks are kept the same for the blog posts but there are a few pages where the url slug will change on the new domain. My ...
0
votes
1answer
35 views

.htaccess old site redirect to new with each url separate redirect

I have a website that is migrated to another URL. So I wanted to migrate my all previous URL to a new URL with a different segment. For example Main redirect Old site is: https:// myoldsite.abc New ...
0
votes
1answer
69 views

How to redirect any subdomain to main domain on shared host?

On VPS, it seems I can use <VirtualHost> to redirect any subdomain to main domain. On shared host, since I cannot edit the apache configuration file, how can I do? Currently, I create a CNAME ...
0
votes
0answers
26 views

How Redirect Question Mark with Uppercase? [duplicate]

I tried redirect this url https://example.com/?MD with this RedirectMatch 302 [A-Z] https://example.com/ But failed, ane helps?
0
votes
1answer
1k views

Nginx ERR_TOO_MANY_REDIRECTS by adjusting WordPress Permalinks | 301 Error Ubuntu 18.04

OS: Ubuntu 18.04.5 LTS (having my own VPS) WebServer: Nginx/1.18.0 MySQL: mysql Ver 8.0.22 for Linux on x86_64 (MySQL Community Server - GPL) WordPress: 5.6 When I change the Permalinks option in ...
1
vote
1answer
2k views

htaccess redirect all urls with question mark parameter to without

I checked a lot, for my question. there are some close, but none that would solve my problem. I need to permanently redirect ALL URLs that end in this: ?mode=list AND ?mode=grid to without (remove ...
0
votes
2answers
48 views

NGNIX Redirect with two Parameter

So at the moment this is working for me: if ($request_uri = "/web/news.php?id=69") { rewrite ^ https://www.camper-center.ch/? last; } But now I also have URLs like /web/listing.php?...
0
votes
0answers
27 views

One single Nginx 301 redirect to HTTPS + with WWW subdomain

please I don't know what I am doing wrong. I have removed a default file entry from /etc/nginx/sites-enabled and there is only one enabled site: server { listen 80; listen ...
0
votes
0answers
23 views

Apache VirtualHost redirection issue - redirects to default

I'm having trouble with my apache config. Several sites are hosted on the server, each connected to a domain. Here's an excerpt from the config: <VirtualHost *:80> ServerName [name].com ...
0
votes
1answer
39 views

Redirecting all versions of URL to main site with 301 status code

I want to permanently redirect all requests starting with the following to https://www.example.com using 301 code. http://example.com http://www.example.com https://example.com How should I edit my ...
0
votes
2answers
199 views

Need support to write a Nginx rule

I have deployed my front end application in 7000 ports. So I need to write a rule in Nginx so that whenever all the HTTP request from 7000 ( HTTP://example.com:7000) port will automatically redirect ...
0
votes
1answer
36 views

Why my nginx redirection doesnt work

I`m trying to do redirection via Nginx webmail.mywebsite.to to gmail.com I`m trying with server { listen 80; server_name webmail.mywebsite.com; return 301 https://www.gmail.com; } But ...
0
votes
1answer
125 views

How can I mnually code a 301 redirection via nginx by adding HTTP fields without return and rewrite? [duplicate]

I noticed that when I create a 301 redirection using nginx (rewrite, return 301), I get the following HTML body: <html> <head><title>301 Moved Permanently</title></head> &...
1
vote
2answers
211 views

Google Cloud Platform Loadbalancer - ERR_TOO_MANY_REDIRECTS

I am using Google Cloud Platform to host a Wordpress site in a VM. I am trying to setup a loadbalancer with CDN. Without the loadbalancer site works fine, there is no http to https redirection setup ...
0
votes
1answer
130 views

Apache redirect domain.com to www.domain.com

I want to redirect domain.com to www.domain.com in apache. But when I try following config It gets double redirect www.www.domain.com <VirtualHost *:80> DocumentRoot /var/www/master/...
0
votes
1answer
265 views

301 Redirect with nginx

I moved my website URLs from this form: https://example.com/category/sub-category/post-url https://example.com/category/post-url to this form: https://example.com/post-url And I would like to set up ...
0
votes
0answers
130 views

Apache: Redirect results in too many redirect, but not with Rewrite

Firstly: is not a duplicate of Redirect, Change URLs or Redirect HTTP to HTTPS in Apache - Everything You Ever Wanted to Know About Mod_Rewrite Rules but Were Afraid to Ask. I'd want to know why in my ...
0
votes
1answer
147 views

Nginx Redirect Wordpress Post URL from "Post Name" to "Category Post Name"

How to make a 301 redirect using Nginx from the Wordpress URL "post name": example.com/best-movies-2020/ to "category post name": example.com/movies/best-movies-2020/ I'm a nginx ...
0
votes
1answer
427 views

Is there an alternative for the error_page 497 option from nginx for haproxy?

When using nginx I can just use the 497 error code specific to nginx 497 HTTP Request Sent to HTTPS Port and redirect to https with this rule: error_page 497 https://$host:$server_port$request_uri; ...

1
2 3 4 5
11