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.
Questions tagged [rewrite]
2112 questions
3
votes
1 answer
IIS Application Request Routing ignore certificate
I use one of development sites as URL rewrite to access other sites.
Unfortunately one of the sites has a certificate error because we access it under VPN under different IP.
IIS says that the link I'm trying to get thru rewrite has "HTTP Error…

Andrew Yukhymchak
- 33
- 1
- 3
3
votes
1 answer
How to redirect with query string in Nginx
I would like to redirect:
something.com/search?keywords='value'
to
something.com/search?q='value'
Here is my Nginx config:
location ~ /search {
if ($args ~* "keywords=(.*)") {
rewrite ^.*$ /search?q=$arg_keywords permanent;
…

Ordidaad
- 131
- 1
- 2
3
votes
2 answers
nginx rewrite url without changing browser address
I want to change the url of a request but the browser address should not change.
To achieve this I have tried the below configuration:
location /my-website {
proxy_pass http://tomcat/my-website;
}
location =/my-website {
…

Syed Osama Maruf
- 103
- 2
- 2
- 9
3
votes
1 answer
Redirect to %-encoded URL parameter using mod_rewrite in .htaccess
There's a couple of things I'm trying to understand in relation to a RewriteRule.
The working rule on a URL strips a query back to a redirect, eg. the…

KdB
- 33
- 1
- 1
- 4
3
votes
0 answers
Apache correctly redirects all URLs of webpage to HTTPS except for base URL http://dev.example.com
Setup is on an ecommerce platform. eCommerce platform uses a uri.php? URI management system to handle serving page contents. Only able to see the htaccess file for the site for the time being [limited server privileges]. No htaccess files in any…

Kris
- 31
- 1
3
votes
1 answer
Redirect www.* URLs in IIS
I need to find an easy and universal way of catching any http://www.sub.example.com URLs and redirecting them to http://sub.example.com (ie stripping out the www)
I'd prefer to implement this once for the server and not for each site, maybe using…

userSteve
- 1,573
- 4
- 23
- 33
3
votes
2 answers
Apache ProxyPass to Tomcat - how to remove context path from URL?
I have Apache conf:
ServerName project.example.com
ServerAlias ci
ProxyRequests Off
Order deny,allow
Allow from all
ProxyPreserveHost on
…

Justas
- 221
- 1
- 6
- 12
3
votes
2 answers
Apache htaccess multiple rewrite conditions for multiple rules
I took over a website and noticed the previous developer had multiple .htaccess rewrite rules, this is a short example:
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\…

Tom
- 143
- 1
- 1
- 5
3
votes
1 answer
Apache rewrite to extract multiple pieces of data from original request URL
Trying to create an Apache rewrite that applies to video files only, over to a dedicated video-serving web-server.
It requires rewrite logic that extracts multiple pieces of information from the original request, including HTTP_HOST domain name,…

K.McCallum
- 33
- 5
3
votes
1 answer
htaccess replaces full URL instead of REQUEST_URI
I'm working on something that should be really simple but hitting head against the wall second day. The URLs redirect requirements are:
non-www => www
non-https => https
/file.html => /utilities/template_handler.php?filename=file.html
The problem:…

Putnik
- 2,217
- 4
- 27
- 43
3
votes
2 answers
Apache case Insensitive mod_rewrite for single rule
I am using mod_rewrite for search engine friendly URLs. I have this line that works great:
RewriteRule ^Pay ./pay.php [L] #Pay
but I would like to also have a match if a visitor types http://example.com/pay (note the lowercase). I have tried using…

Sabyre
- 43
- 1
- 5
3
votes
1 answer
Nginx: serve index.html in the closest parent folder
I'm running several SPAs in separate folders together with some static files. The structure is as follows:
|
|- index.html
|- foobar.html
|---- SPA1/
| |- index.html
| |---- SPA1_1/
| |- index.html
|---- SPA2/
|-…

lz96
- 131
- 5
3
votes
0 answers
What's different between try_files and rewrite?
I want to redirect all dynamic request to index.php
for example my index.php :
here is my nginx configure of php:
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass 127.0.0.1:9000;
…

Mattia Dinosaur
- 143
- 2
- 7
3
votes
1 answer
I need to configure haproxy with multiple ssl ports
I have two servers which have the same URL but the port number may change.
I want to redirect these two URLs HTTPS.
If I enter my first URL (http://example.com) then I want to it will redirect to https://example.com.
If I enter second URL…

parag bharne
- 33
- 1
- 4
3
votes
1 answer
VirtualHost/.htaccess - redirect from .com to .se/en not working/ignored (Polylang?)
I'm trying to redirect domain.com to domain.se/en, but it just won't work. It's like another rewrite or redirect is happening to domain.se/sv before I get the chance. I've tried multiple VirtualHosts configs and .htaccess variants without success.…

Jesper Johansson
- 131
- 2