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.

learn more… | top users | synonyms (5)

0
votes
1answer
38 views

Nginx Url Beautify with Rewrite

Currently i have my own domain example like abc.com, but when i click another page in abc.com i saw that the url have too much thing then i expected, code like below abc.com/index.html?utm_expid=...
-1
votes
1answer
45 views

How does nginx rewrite break flag work?

I'm trying to set up a "coming soon" temporary page on a website: rewrite ^/(css|img|js)/ - break; rewrite ^/$ /comingsoon.html last; rewrite ^ /? ...
0
votes
0answers
9 views

I want to rewrite the path with with htaccess [duplicate]

When I visit this link: http://user.demo.net/email@homepage.com/ It will be interpreted as follows: http://user.demo.net/data/email@homepage.com/ I tried this code but it appears the 505 error ...
0
votes
2answers
63 views

Subdomain redirection, URL Masking

My issue is simple but I can't seem to find the solution. I have a domain www.domain.com that has subdomains. www.domain.com 's document root is /home/domain/public_html Subdomains (excluding www) ...
0
votes
2answers
87 views

nginx check if filename with different extension exists

If a file with ".html" extension doesn't exist I need to know if the same file exists with ".th.html" extension and make a redirect. Right now on 404 I'm doing a rewrite and if $request_filename ...
0
votes
1answer
32 views

Masking URL, Subdomain redirection

We have hosted a Java web application for www.domain.com on Apache & Tomcat. I have two problems, as follows 1) Directory Index in Apache lists home.jsp ahead of redirect.jsp. For my domain.com ...
0
votes
1answer
28 views

ASP Redirect Base URL Being Rewritten by IIS

I am attempting to debug, what I think is, an IIS rewrite issue. I am hosting multiple sites on a single IIS server which is acting as a proxy to Kestrel hosts behind the scenes. That is all working ...
-2
votes
1answer
42 views

Best way to remove file extension from URL

I want an URL without file extension to resolve to a file. There seem to be several options:   1 mod_rewrite Name the file "file.html" and rewrite the URL. 2 mod_negotiation Name the file "...
0
votes
1answer
48 views

URL Rewrite to different port on IIS 7.5

I have an IIS server with diferents sites running on diferents ports, for example: site1 runs on port 8025, site2 on 8026, site3 on port 8027. I want to configure URL rewrite so the user only have to ...
0
votes
1answer
21 views

Change subdomain url to subdirectory without redirection

I found a few questions and answers close to what I am trying to solve, but not quite. I see references to using mod_rewrite to change url paths without redirection. But, what I am looking for is, ...
1
vote
0answers
54 views

Nginx trailing slash redirect issue

I am running a Wordpress website with Nginx + Varnish. I am getting The page isn't redirecting properly error if I am adding or removing trailing slash in the configuration file. Please suggest the ...
2
votes
3answers
1k views

Server remembering old rewrite rules, even when I remove htaccess

I have set up a development server with Ubuntu and LAMP, but for some reason the .htaccess is acting strange... There is a site on there with a set of rules, when I comment them out they still work, ...
0
votes
1answer
121 views

Nginx rewrite certain port to subpath (nginx + uwsgi + django)

My goal is to rewrite everything under http://localhost:8000 to http://localhost/foo I followed every step mentioned in this link, but still couldn't get it work. Here's my settings: urls.py (...
0
votes
0answers
6 views

How to redirect all specific character strings? [duplicate]

I want to redirect all character strings to the index page using the RewriteCond Directive. A few examples to illustrate my intention www.example.com/character-string/ should redirect to www....
0
votes
1answer
24 views

Using RewriteRule to match RewriteMap value and ignore any trailing slash and characters?

I'm trying to use RewriteMap in a apache 2.4 virtualhost .conf file to redirect a number of URLs. A variety of requests can refer to a single entry in the map and I'm having trouble matching these ...
0
votes
1answer
19 views

Server 2012 URL Rewrite Module 2 always has 404

URL rewrite was working perfectly on Windows Server 2008, but I'm getting 404 errors when using the same configuration on Server 2012 <rewrite> <outboundRules> <...
0
votes
1answer
31 views

apache2 rewrite rule: delete any path from URL

I'm going crazy with a Rewrite Rule on Apache. Basically what I want to achieve is to rewrite any url like: http[s]://www.example.com/something to https://www.example.com I have a VHost on ...
0
votes
1answer
39 views

reorder url parameters (GET) with nginx or apache

Is that possible to reorder the GET parameters from a request (alphabetical) before it hits my application ?
1
vote
1answer
38 views

Nginx rewrite - remove substring at the end of URL

I have a faulty plugin that is generating URLs with /mobile at the end. I am trying to fix the plugin but in the meantime I would like to write a Nginx rewrite rule to redirect as shown below: http://...
0
votes
1answer
94 views

Apache rewrite rule to redirect a URL with parameters to a URL without parameters [duplicate]

I want to go from: www.website.com/directory/results?category=10&dir=asc to www.website.com/staticfile.html I tried the following and it doesn't seem to catch: RewriteRule "^directory\/...
0
votes
1answer
353 views

Redirect non-www to www., AND rewrite everything to /

I want to redirect all traffic to example.com to www.example.com, and then rewrite everything to /. So if a visitor by some reason hits http://example.com/foo/bar I want to redirect them to http://...
4
votes
6answers
21k views

How do I remove trailing slashes from a URL when using Apache's default directory index file?

I am using Apache to serve a blog which consists of static HTML files. Currently, the blog uses a pretty standard URL structure, like this: /2010/03/21/my-awesome-blog-post/ which maps to the file ...
0
votes
1answer
67 views

Redirect all the traffic from multiple domains to single domain using htaccess

I have hosted multiple websites on my server all sharing the same code base having one htaccess. I need something like this. if (domainname != example.com) redirect to example.com if there ...
1
vote
1answer
26 views

Removing path segments with encoded values for nginx

I have a location block like the following location ^api/([^/]+)(/.+)$ { set $my_host $1; set $my_path $2; proxy_pass http://$myhost$my_path$is_args$args; } This works well for most ...
0
votes
0answers
31 views

friendly urls with / at the end of the url

I'm trying to set up the file "nginx.conf" for friendly urls. I have the following urls: / -> /index.php /view/ -> /view/index.php /view/client/ -> /view/...
6
votes
0answers
8k views

How to use IIS URL Rewrite with gzip compression

I've been trying to create outbound rules in IIS 7.5 on Windows 2008 R2 on a site that has static HTML pages and compression enabled. If I have any form of compression enabled (static or dynamic) I ...
1
vote
2answers
40 views

Nginx Proxy rewriting with condition for domain [closed]

I am in a quite unknown situation but I believe it can be done using nginx proxy and url rewriting feature. What I want to have is: Have a website with multiple branding, so let's say I have 3 ...
0
votes
0answers
37 views

301 Redirect from a url pattern with nginx

I'm trying to redirect www.mysite.com/blog/ and www.mysite.com/blog/* URLs to a single page www.mysite.com/news/ I tried to achieve this with the following (inside a server block): location /blog/ { ...
0
votes
1answer
43 views

Nginx Url Rewriting: Remove folder from the url

Im trying to rewrite a url like below: https://example.com/products/xperia-z5/ to--> https://example.com/xperia-z5/ But i want in the same time the url https://example.com/products/ to be ...
1
vote
1answer
17 views

File in the same subdirectory as the HTML in CMS

I have a CMS installation with a link such as journal.org/archives/volume136/number10/37362-49383 I want to place a few PDF files in the same directory as the above HTML such that the PDFs are ...
-1
votes
2answers
74 views

To hide “#” from the URL using Nginx

I am using Nginx web server to host my website. I need to hide "#" from URL. Actual: example.com/#page2 Requirement: example.com/page2 Our web page developer says that, here #page2 is defined as id ...
1
vote
0answers
24 views

nginx prevent loss of POST parameters when rewriting uri

I would like to do some url rewriting on nginx with php-fpm. Namely, routing all requests to php scripts to a single script like: /index.php?fulluri=(originaluri) Many ways to approach the problem: ...
2
votes
1answer
33 views

Nginx rewrite filename as a directory

I want to rewrite a file name membership-list.html as a directory on the root domain as membership-list/. I had this in my config file: location = ^/membership-list.html { rewrite ^/membership-...
1
vote
1answer
63 views

Nginx as reverse proxy with IBM Websphere upstream

I have an IBM WebSphere serving multiple domains: x.x.x.x:8080/app1 x.x.x.x:9090/app2 ... I need to configure Nginx as reverse proxy to serve: app1.example.com app2.example.com Here is my config but ...
0
votes
0answers
13 views

IIS 8 port rewrite and ProxyPreserveHost equivilent

I've had a simple IIS 8 URL Rewrite rule in for a long time now and it was working perfectly. It basically just rewrote: http://helpdesk to http://helpdesk:8080 Has been working fine, the purpose ...
0
votes
0answers
26 views

How do I pass in matches via ProxyPassMatch?

I'm using mod_proxy_fcgi and I have this line in my vhost: ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/housni-test/$1 I want a URL like /media/4228dedb-9855-4894-84f5-...
0
votes
1answer
1k views

HSTS & redirects on IIS 8.5

I'm having a problem getting my IIS 8.5 server to behave as desired. I am attempting to host two domains on the same IP address, both on https, using separate webservers. Naturally, IIS is setup as ...
19
votes
10answers
27k views

How to inject HTML code into every delivered HTML page?

I've got an Apache web server that delivers static HTML pages. For some reason I can't change the files themselves, but I still want to inject some HTML into every page that is being served. Is this ...
1
vote
1answer
113 views

Nginx rewrite rule subfolder 404 error

I cannot figure out how should I setup my index.php file with Nginx rewrite rules that it will work like example below. If I visit the url it gives me 404 error not found instad echo 'hello'. URL: ...
1
vote
1answer
203 views

Haproxy 301 URL redirect on query string condition

Using Haproxy 1.5.12 running on Ubuntu 12.04 My website gets a lot of requests like this one: http://www.example.com/foo/bar/mypage.php?gallery=&position=3 the correct URL should be: http://...
2
votes
1answer
31 views

How to do multiple redirections with if statement in nginx [closed]

So my question is half oriented SEO half technical : I have a lot of links to redirect and instead of doing them one by one I was asking my self : Is there a way to write a rewrite rule like that (...
1
vote
1answer
30 views

Redirect to HTTPS and subdirectory is visible [duplicate]

I am forcing HTTPS and redirecting to subdirectory with: RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301] RewriteCond %{HTTP_HOST} ^domain.com$ [NC,OR] ...
4
votes
1answer
1k views

How to change filename on the fly depending on the title args - nginx rewrite

i am serving .pdf files using nginx web server. and setting filename of .pdf file using rewrite rule , depending on the title args. what i am trying to do is, add my domain name example.com in the ...
0
votes
1answer
2k views

NGINX - Cannot set Cache-control for redirected .js files (with alias + rewrite)

I have successfully setup an nginx server which uses both alias + rewrite as in the below configuration. Everything works except that javascript files are not enforced browser caching. Server url: ...
0
votes
1answer
1k views

Hyper-V Guest Connectivity Problems

I have one particular Hyper-V guest, one of 5 on this particular Hyper-V host, that can't seem to make any outgoing network connections. The guest is running Windows Server 2008 R2 SP1 and uses IIS 7....
0
votes
0answers
1k views

Nginx rewrite url with parameter

I hope some can help me with that: I need to redirect an url thats called inside my shop to logout customers from their account. Since I have switched to Nginx Server it does not work. I am using a ...
1
vote
1answer
1k views

Nginx Try_Files to create local content cache?

I'm trying to either serve images locally, or from a share (locally refreshed overnight). My nginx site is served across 2 or more servers, to keep all the content in sync across each server, I'm ...
0
votes
1answer
92 views

Image not display after using nginx

recently i change my web server from apache to nginx, my site using using wordpress and use google drive wp media plugin to store image in google drive , after i change to nginx all image suddenly ...
0
votes
2answers
5k views

Serving multiple directory in one path/location with nginx

I have been trying serve multiple directories in one location so that all files can be access on /sys/assets/--FILE-- regardless of where is the file physically locate in the following folder ...
0
votes
0answers
1k views

Apache redirect to change URL if user comes in on it, but also proxy redirected address

I have the following setup: Java application at www.mysite.com New angular application for part of my site www.mysite.com/details (www.mysite.com/details exists in the old site as well) In order to ...