Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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
4
votes
3answers
618 views

The 301 'www' nightmare. How do I change back?

About six months ago, I decided it would be best to put my website on the naked domain, let's just say 'example.com'. I did what all the instructions websites have told me with adding a 301 redirect ...
1
vote
1answer
325 views

Apache - How to Ignore Paths and Paramaters in 301 Redirect

Say I want all requests to example.com to redirect to abc.com. How can I make everything redirect to the root of abc.com and not include any paths or parameters included in example.com? For example ...
0
votes
1answer
133 views

Preserving URLs after CMS migration with redirect database and apache http?

We will migrate an entire intranet from one CMS to another. All URLs will change in a non-predictable pattern, but I can capture a file with original,new URLs I can feed into anything. I have hundred ...
1
vote
1answer
4k views

Nginx map module 301 redirecting

I've rebuild my website in Ruby on Rails and now I want to 301 redirect a lot of old urls using Nginx's http://wiki.nginx.org/HttpMapModule For some reason I can't get it to work. It works fine ...
5
votes
3answers
15k views

How to configure nginx to redirect all request from domain aliases to main domain?

I do have an nginx server which responds to several domains and I do want to redirect all request to the main domain. Example: website responding for xxx xxx.example.com yyy.example.com $hostname for ...
-1
votes
1answer
167 views

Doing A 301 Redirection [closed]

Well just wanted to know if there is any way to do a 301redirection if my domain provider doesnt provide it. My domain provider is bigrock and hosted on blogger so it's big crappy for me. Thanks
-1
votes
1answer
711 views

40.000 lines of 301 Redirect in httpd.conf [duplicate]

Possible Duplicate: best way to handle thousands of permanent redirects As object. I need to do 301 redirect, for about 40.000 pages. I know that putting this quantity of lines in .htaccess ...
0
votes
1answer
613 views

Redirect aspx in apache

I had a site in ASP.NET, and now we moved it to WordPress. The pages in the .NET site have parameters in them. I'd like to redirect the old pages to their new locations, but Apache doesn't seem to ...
7
votes
3answers
9k views

Nginx reverse cache 301 redirects (permanent)

Is it possible to have Nginx cache all 301 redirect requests for proxy_pass? For example: Request #1: Client A requests /some/path -> sent to proxy_pass -> results in 301 redirect to /some/other/...
6
votes
3answers
6k views

NGINX 301 and 302 serving small nginx document body. Any way to remove this behaviour?

We have noticed that when using nginx internal 301 and 302 handling, nginx will serve a small document body with the appropriate Location: ... header. Something along the lines of (in html): 301 ...
0
votes
1answer
84 views

How to move site and switch link structure using HTTP 301 redirect

I currently have my wordpress blog (apache2, ubuntu linux) hosted at e.g. mysite.com using ID-based linking, e.g. http://mysite.com/?p=547. I have two goals: move my blog to mysite.com/blog change ...
3
votes
1answer
5k views

301 redirect Rule For Load Balance F5 BigIp

I have a load balancer F5 Big ip for my website. Currently, I am having 302 redirect in place; however, I wanted to apply 301 but dont know how. For example: My website (abc.com) when typed 302 ...
2
votes
1answer
105 views

Is 301 redirects enough for RSS feeds, or will some readers fail?

I am in the process of moving an entire site from ID based pages to user friendly / descriptive urls, and I would like to move the blogs as well. My problem is then, that I am uncertain if 301 ...
20
votes
2answers
6k views

Apache: What is the best way to handle thousands of permanent redirects?

We've a list of 3000 301 redirects. We need assistance on What would the best place to put these? It seems putting these 3000 lines inside vhost in httpd.conf would be a mess. What are recommended ...
1
vote
0answers
286 views

301 redirects along with URL rewriting to reduce URLs with query params

Okay, so I have URL rewriting set up on my server (IIS 7) so that, for example, http://example.org/p/1234/ is really http://example.org/product/?product_id=1234 (With /product/ containing an index ...
2
votes
1answer
3k views

nginx 301 redirect does not work for www. subdomain

I am attempting to create a 301 re-direct from one domain to another with nginx. Here is what I'm currently doing and it works as I want: server { listen 80; server_name ...
0
votes
1answer
359 views

.htaccess to redirect all pages from domain to directory on same domain except root, /index.html, /index.php

I've searched and tried everything I've found and nothing seems to work quite right. What I'm trying to do is: redirect all pages from a domain (domain.com) to a directory within the same domain (...
2
votes
0answers
537 views

.htaccess Redirect 301 loop

I'm having an issue implementing 301 Redirects via .htaccess file on an Apache server. I can enable the 'Redirect 301' statements in the .htaccess file and they will appear to work for a few minutes, ...
0
votes
3answers
371 views

Apache rewrite - Redirects to example.com// instead of example.com [duplicate]

When trying to redirect an URL in apache from: www.example.com to example.com it redirects to example.com// This is a one page webserver, Fixed IP goes directly to the page. Editing directly ...
0
votes
2answers
288 views

.htaccess rewrite all queries to static page

I have an account where hundreds of inbound links to their calender are showing up as 404 (they moved their site to a new platform). I would like to make a wildcard redirection of all URLs with a ...
4
votes
3answers
1k views

CNAME versus an additional A&AAAA record

So, let us say that we have set-up an A record and an AAAA record for @, and for www we have set-up a CNAME pointing to @. When a new visitor visits example.com and the webserver sends a 301 ...
0
votes
1answer
238 views

rewrite redirect issue in debian squeeze

My server os is debian squeeze. I have these lines to redirect non-www to www in htaccess file of my website: RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC] RewriteRule ^(.*)$ http://www.example....
1
vote
1answer
784 views

Apache2 name based virtual host always redirect 301

I've got a server (runnging Debian Squeeze) with Apache 2.2, there are 4 site running there. I'm using namebased virtulhosts because I've got a single IP. Initial configuration has been made with ...
10
votes
1answer
4k views

Empty/Null Apache request entries in access log

This entry got logged in a Apache access log: IP ADDRESS - - [00/00/0000:00:00:00 -0000] " " 301 - "-" "-" It was detected by LogWatch as a null HTTP Response and also got marked as a successful ...
5
votes
1answer
2k views

Mass 301 redirect URLs with Nginx

I have a list of 600 urls. Due to a change in the system the urls will change to a new format. I will have a list with the old urls and corresponding new ones. But how do i 301 redirect all of them? ...
1
vote
1answer
247 views

Google anaylics and multiple domain problems

The problem is that we apparently don't receive any tracking of google analytics. We have X domain for that particular site. Google analytics only appear to support one domain unless you setup links ...
2
votes
0answers
537 views

Why are 301 redirects intermittently slow or time out in IIS 6?

I'm no IIS wiz, but I can provide any additional info that might be helpful. My site uses a 301 redirect to send requests for mysite.com to www.mysite.com. They are two separate sites in IIS. Most of ...
0
votes
1answer
97 views

Rewrite a directory to / while keeping actual directory structure in tact?

My site exists www.site.com/forum I have no need for /forum but I do not want to go through the effort of changing everything. Is there a way I can get Apache to rewrite the URL so that it uses the ...
149
votes
5answers
298k views

Nginx reverse proxy + URL rewrite

Nginx is running on port 80, and I'm using it to reverse proxy URLs with path /foo to port 3200 this way: location /foo { proxy_pass http://localhost:3200; ...
1
vote
2answers
436 views

Can you help me find out where the example.com to www.example.com rewrite is coming from?

Here's my NGINX config (no apache, just php-fpm): user nginx; worker_processes 1; error_log /usr/local/nginx/logs/error.log notice; pid /var/run/nginx.pid; events { ...
0
votes
2answers
188 views

virtual domain redirection working only partially with apache 2.2

Apache 2.2.3 running with a lot of virtual hosts (boiled down to 3 Zope instances), configured in separate files. Works quite well, with one exception: The redirection of mydomain.net to www.mydomain....
1
vote
1answer
93 views

Strange 301 redirect behaviour

The 301 is redirecting but it is appending the old url onto the end of the new url, like so: http://www.example.co.uk/new-dir/new-page/?/old-dir/old-page/ This is my .htaccess RewriteEngine On ...
9
votes
2answers
13k views

How to trace Apache 301 Moved Permanently?

I have one virtual host on my machine, which I am accessing localy. I am running apache2 under windows 7. When accessing this host, I see in Fiddler, that server redirects browser to different remote ...
0
votes
1answer
153 views

301 redirect (mod rewrite) a whole folder and all files with the get parameters

I want to redirect all urls starting with www.site.com/online/ to www.site.com some examples of the files I'm trying to redirect are ... www.site.com/online/folder1/folder2/folder3/?gdt=...
0
votes
2answers
209 views

Apache: Redirect all hits on subdirectory (301)?

Probably a simple problem, but I cant seem to figure it out: I've recently created a new website from scratch to replace an older website. The old website had a good SEO ranking which is obviously ...
0
votes
1answer
245 views

301 permanent redirect with extensions and sub folders

I tried to permanent redirect 301 from http://example.com to http://example1.com RewriteEngine On Options +FollowSymLinks RewriteCond %{HTTP_HOST} ^test\.example\.com$ [OR] RewriteCond %{HTTP_HOST} ^...
2
votes
1answer
930 views

.htaccess 301 redirect, same server

I set up a website at mywebsite.net, but recently bought the domain mywebsite.com. Now I updated the information on Google via Webmaster Tools and it recommended we set up a 301 redirect from the ....
3
votes
1answer
245 views

Need some help on optimizing 301 redirects in nginx

I just created a new structure for a website, and I need some help on redirecting to new places. The code that works is here, but I guess this can be optimized a lot. location = /nl { rewrite ^ ...
0
votes
1answer
2k views

htaccess rewrite all URLs (inc image hrefs) from one domain to another

I've got a wordpress blog on a subdirectory which I've recently migrated from a .com to a .co.uk (myurlstudio.com/blog to myurl.co.uk/blog). The problem is that many of the posts have images in them, ...
-2
votes
2answers
180 views

301 redirect from one subdomain.domain1.com to domain2.com

Title says it all really, I want to be able to 301 redirect from subdomain.domain1.com to domain2.com. I have full access to the servers and have tried various things using .htaccess but have had no ...
4
votes
1answer
13k views

Apache - httpd.conf redirect with X-Forward-For - Not working?

I'm having an a-hole of a problem redirecting traffic. Basically, I'm building a new web server and it's on another version of my domain, so I want to redirect traffic not from this IP. Problem is ...
3
votes
2answers
29k views

How to redirect example.com from HTTPS to HTTP, then HTTP example.com to newdomain.com?

As of now I use this rule (in .htaccess of example.com) to redirect HTTPS/HTTP example.com to newdomain.com: Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://newdomain.com/$1 [R=301,L]...
3
votes
1answer
7k views

NGINX: strip querystring in rewrite

I'd like to make a 301 rewrite to the sites's index without any querystring. Like this: http://example.com/anypage.asp?anyvar=anyvalue To: http://example.com/ Here's a real example: http://...
2
votes
1answer
706 views

NGINX: 301 rewrites

I have a list of 301 rewrites to set in Nginx. And I want to specify exactly the uri instead of using regex. What's the write way to do that? This is what I think it should be done: rewrite /o-...
2
votes
2answers
281 views

.htaccess 301 redirect PLUS url rewrite

Premise: My photography website is www.domain.com and my blog is on www.domain.com/blog. Everything is on self hosted wordpress platform. On my index page I have my photo galleries. I now would ...
2
votes
3answers
2k views

Nginx: 301 redirect without query strings

I am redirecting /example.php?var=value to /index.htm like this: rewrite /example.php?var=value / permanent; However, the browser ins printing the final uri like this: domain.com/?var=value How ...
-1
votes
1answer
159 views

Nginx: simple page redirect

I'd like to make two simple 301 page redirections. For example: http://domain.com/example.php?var=value and: http://domain.com/some-page Both redirecting to: http://domain.com/index.htm Which ...
2
votes
2answers
689 views

How do I do an .htaccess 301 redirect of a query string?

I'm trying to redirect a url http://domain.com/?p=106 to http://domain.com/?p=110 My .htaccess file looks like this: RewriteEngine On RewriteCond %{QUERY_STRING} ^p=106 RewriteRule / http://domain....
3
votes
1answer
1k views

Conditional 301 redirect depending on server (localhost vs production)

By practise I do a 301 redirect non-www -> www for my production server deployments. But I have a little annoying problem/discrepency with the .htaccess rewrite settings between my development server ...
0
votes
1answer
597 views

Issue with mod_rewrite (possibly related to special characters?)

We have just made a new website for a client and for SEO purposes have a HUGE urlmap setup to rewrite the old site URLs to relevant places on the new site. Technical details are: CentOS 5.6 Apache ...