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
0 answers
17 views

Nginx works with IP address but not URL for home page, gives too many redirections error

I have spent the last 2 days going over a lot of questions like this but I can't seem to understand what I am doing wrong or if for some reason my case is just different. So yes I know this is a ...
0 votes
0 answers
37 views

Rewrite subdirectory to root (Apache)

We have a mod_rewrite question here about going from subdirectory to "root" Here are a few strings : /fr/spil/spil-til-pc/steam/publisher/dovetail-games /fr/spil/franchise/little-nightmares/...
0 votes
0 answers
6 views

Redirects Stopped Working Properly

My .htaccess file look like this: Options +FollowSymlinks RewriteEngine On RewriteBase / RewriteRule /oldpage newdomain.com/newpage [R=301,L] RewriteRule /oldpage2 newdomain.com/newpage2 [R=301,L] ...
0 votes
0 answers
28 views

Rewriting URL encoded with htaccess

have a single page website that uses the hash (!#) to access different pages. he problem is that some product viewers break my links encoding the hash character, replacing !# with domain main , so for ...
0 votes
1 answer
52 views

nginx: [warn] server name has suspicious symbols with long domain redirect

What is the best way in Nginx to redirect two Long domains URLS, I would like to configure a redirect between two domains like this: I'm sure this has been asked before, but I can't find a solution ...
0 votes
0 answers
30 views

Issue with Nginx Url Rewrite /Redirect

For new site config I tried NGINX rewriting for the blog plan and keep the paths the same, just redirect from 'www.' to 'blog.'. and plan for RSpace API and CME have been configured and the ALB. www....
0 votes
1 answer
23 views

route your blog from xyz.com/blog/ to abc.com/blog/

My WordPress website domain name was abc.com (let's say) now due to a new partnership agreement the domain name is changing to WordPress xyz.com (let's say). I tried this answer https://stackoverflow....
  • 103
0 votes
3 answers
51 views

Best way to do 301 redirects

Which is the best way to do 301 redirects (for whole domains and also for specific pages/directories)? Using Apache virtual blocks, .htaccess or other solutions? "Best" for me probably means ...
  • 113
0 votes
0 answers
39 views

Redirection for WP website

We have a WP website in an EC2 instance. Over that, we have a CloudFront distribution which is serving the DNS requests. At times we face the website error - redirected too many times. While checking ...
0 votes
0 answers
10 views

Apache redirects - issue with redirects in query string

I have lots of apache permanent redirects for site that look like this: Redirect 301 /old-path https://new.com/lang/new-path/?utm_source=old.lang&utm_medium=301 When the path doesn't match ...
  • 1
0 votes
1 answer
393 views

Regex to remove certain patterns from urls

So i've tried this multiple times but to no avail. Basically, what I am trying to do is check if the URL has a certain language locale and remove it and do a 301 redirect to the parent url without the ...
0 votes
1 answer
60 views

Having trouble getting a regex to redirect traffic to work correctly

I'm trying to setup some 301 redirects on WPengine using regex and I'm having trouble getting things working. Old URL: https://www.website.com/abc/123 New URL: https://www.website.com/abc For pages ...
0 votes
1 answer
319 views

Redirect all pages to non www and one page to www

I want to redirect all my internal pages (eg: example.com/about) to their non-www version but I want my homepage (https://example.com) to redirect to its www version (https://www.example.com). I ...
0 votes
0 answers
24 views

How to redirect a specific list of webpages to a subdirectory

I am moving some blog articles from the root directory to a subdirectory named blog/. How do I configure Nginx to permanently redirect a specific list of web pages to that subdirectory? Of course, I ...
  • 103
2 votes
4 answers
1k views

How can I redirect domain A to domain B without hosting, using only DNS records?

I want to redirect domain A (without hosting space) to domain B (301), but when I try https://domainA.com or https://www.domainA.com it ends with ERR_CONNECTION_REFUSED. Is it even possible to use ...
0 votes
1 answer
492 views

Nginx http to https redirects download empty file instead

Im trying to redirect my Laravel+vuejs+nuxtjs project from http to https but when I enter http://example.com or http://www.example.com an empty file being downloaded instead What have I done so far : ...
  • 21
0 votes
0 answers
83 views

How to not redirect if is from social media site with Nginx?

How do I not force a redirect if it's from a social media site like reddit,facebook & twitter? Currently my setting is set to redirect any direct access to image files but I don't want to redirect ...
0 votes
0 answers
251 views

Host Header Redirect to another domin when Host is changed to another domina in HTTP Request

Click for the image of issue for HOST Header Redirect Please Refer to the image The issue arise only on 302 and 301 Redirect request On Apache Server. What i did is selected one 302 and 301 redirect ...
0 votes
1 answer
302 views

301 Redirect old domain to new and use the old domain for emails

What I want to do: Part 1. Redirect old domain to new domain. Part 2. Use the old domain for mails My current setup: Both domains are set up with Google Load Balancer and using Google managed SSL. To ...
0 votes
0 answers
58 views

mod_security blocks redirects (to non-www and https)

httpd-vhosts.conf <VirtualHost *:80> ServerName example.com ServerAlias www.example.com DocumentRoot "c:/web/www/mysite" Alias /.well-known c:/web/www/...
  • 1
0 votes
1 answer
103 views

301 redirect for some pages and all other pages

I have two websites. Let's say siteA.com and siteB.com. Now I want to add 301 redirect to siteB.com. Some of pages of siteB.com need to be redirected to some specific pages on siteA.com All other ...
0 votes
1 answer
102 views

https request on github.com subdomains return wrong 301 redirections to domain

First When executing curl -iv4 https://support.github.com/contact I am receiving 301 responses with location https://github.com/contact. Obviously when executing curl against the location returned ...
1 vote
1 answer
76 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 ...
  • 13
2 votes
1 answer
131 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 ...
  • 155
0 votes
1 answer
110 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 ...
  • 21
0 votes
2 answers
1k 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
0 answers
264 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
67 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/...
  • 177
0 votes
0 answers
26 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
1 answer
2k 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
53 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
0 answers
69 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
0 answers
319 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
3k 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 ...
  • 11
0 votes
2 answers
108 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 ...
  • 11
0 votes
2 answers
76 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 ...
  • 13
0 votes
0 answers
219 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
1 answer
365 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] ...
1 vote
1 answer
908 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
1 answer
90 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.
  • 199
1 vote
2 answers
2k 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 ...
  • 11
0 votes
1 answer
458 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 ...
  • 3
1 vote
1 answer
294 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
1 answer
743 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 ...
  • 3
1 vote
0 answers
15 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
1 answer
136 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. ...
  • 21
-3 votes
1 answer
284 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
1 vote
1 answer
1k 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
1 answer
45 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 ...
  • 1
0 votes
1 answer
498 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 ...
  • 69

1
2 3 4 5
11