Questions tagged [rewrite]

URL Rewriting maps an incoming URL to a modified URL, so that the request is processes as if the original request was made to the modified URL. This is often used to provide more search engine friendly URLs.

2112 questions
4
votes
1 answer

Nginx Proxy/Upstream redirects use wrong port and protocol

I am using an NGINX server as an ssl proxy for some other NGINX servers. Unforntunately if a request is redirected by an upstream server, the location field contains the wrong destination port. curl -v "https://example.com/site": > GET /site…
alumaster
  • 53
  • 1
  • 4
4
votes
1 answer

IIS10 URL Rewrite 2.1 double encoding issue

I have an IIS10 server with ARR 3.0 and URL Rewrite Module 2.1 that acts as a reverse proxy for several other web servers. The other servers run on different ports, so the IIS10 server provides 'friendly URLs' on port 80. URL rewriting is used to…
Jorge Martins
  • 161
  • 1
  • 5
4
votes
1 answer

How check in nginx for query_string parameters?

How I can write a condition in the nginx config testing if a q parameter was entered in the URL? This doesn't work: if ($arg_q) { return 301 "/someurl"; } It catches URLs like /search?entered_search=1&q=123 But it doesn't catch URLs…
astropanic
  • 307
  • 2
  • 5
  • 18
4
votes
1 answer

rewrite / restrict specific domain name in apache

We have https://example1.com/login and example2.com/login being hosted from the same apache server (2.2.22). I want to restrict /login on example1.com. example1.com/login --> 404 (preferably) or 403 example2.com/login --> login page I…
akay
  • 53
  • 1
  • 5
4
votes
5 answers

Rewrite rule for nginx (Opencart)

Opencart has this URL structure: http://example.com/index.php?route=common/home http://example.com/index.php?route=account/register http://example.com/index.php?route=checkout/cart http://example.com/index.php?route=checkout/checkout ... and I want…
3br4him
  • 91
  • 2
  • 4
4
votes
2 answers

php routing url to index.php nginx

I am running a nginx/ php5.6-fpm server and I have the following server { listen 10080; listen [::]:10080; root /home/vagrant/app; index index.php; server_name mia-dev.dev; port_in_redirect on; …
Kendall
  • 247
  • 2
  • 4
  • 13
4
votes
2 answers

Clean URLs and php extension on nginx

I've looked at dozens of other questions and references on the web - and by all my calculations, my setup should work, but it doesn't. I have nginx installation with php-fpm. If I try to access a .php file, it runs correctly and I get the correct…
Aleks G
  • 936
  • 2
  • 8
  • 18
4
votes
1 answer

nginx rewrite of url with query string

I have been googling for a good while and can't figure this one out. It seems simple, and I am sure it is, but I am not a server expert. My url is: http://www.example.com/blog/?tag=Word1+Word2 Some of the tags are a single word (ex: bicycle), some…
TJ Sherrill
  • 141
  • 1
  • 1
  • 4
4
votes
0 answers

Is websocket reverse proxy possible with IIS 8.5 & URL rewrite 2.0?

I installed Tomcat as a java app server behind IIS. Using the following rules I can rewrite static pages just fine, but alas, websocket connections are never established:
Mirco
  • 53
  • 1
  • 5
4
votes
1 answer

Apache rewrite works under FreeBSD, not under CentOS

I have 5 production servers which are running FreeBSD 9.2, but we are planning on transitioning to CentOS. Because of this, I am attempting to set up some virtual machines to emulate our production server environment using CentOS 6.6. I have set…
Peter
  • 123
  • 1
  • 1
  • 7
4
votes
1 answer

Rewriting ASCII-percent-encoded locations to their UTF-8 encoded equivalent

For example, “å” can be encoded as /%E5 and /%C3%A5 (utf-8). All my filenames are UTF-8, so the ASCII variants return a 404. I want both variants to work. I have tried rewriting the incorrect URLs to the correct encodings with variations of the…
Daniel
  • 211
  • 3
  • 16
4
votes
1 answer

Can't find IIS Rewrite Rule in Config XML

I created a new URL rewrite rule through the IIS manager GUI. But when I browse to the site config XML file, I don't see any rewrite rules even though I have confirmed the rewrite is working. I had expected that the rewrite GUI would generate the…
alexp
  • 205
  • 3
  • 5
4
votes
4 answers

How to redirect or rewrite IIS site with port in URL to URL without port?

I'm not 100% sure if this is the right part of StackOverflow to post this but to me it made the most sense. Sorry if its not! Currently I have a site in IIS configured on HTTPS with port 7500. I can access this site by using the URL:…
user2573690
  • 151
  • 1
  • 1
  • 3
4
votes
1 answer

How to organize millions of static files to serve efficiently over the web?

I'd like to create a service to serve several hundred thousand smaller files (from 5kb to 500kb, mostly around 10-100kb). Think of it as a kind of gravatar.com which serves those little avatar pics on URLs like…
user168080
  • 41
  • 2
4
votes
2 answers

Apache configuration - rewrite rule for all virtual hosts

I have the following configuration with 2 virtual hosts on my Apache: www.domain.com and res.domain.com. The first one is open the second is limited to registred users. ServerName www.domain.com DocumentRoot /website/www …