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

url rewrite to redirect from domain to sub directory

I want to be able to host multiple domains on one site and have been following the blog here I have the following bindings set up in applicationHost.config <binding protocol="http" ...
0
votes
1answer
3k views

Nginx URL virtual host rewrite issues with Magento e-commerce. Help please

I've been running into some serious problems with my URL rewrites and I can't seem to fix it on my own strength and knowledge and troubleshooting on the web! Basically what happens is that when I ...
0
votes
1answer
24 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
14 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
25 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/ -> ...
6
votes
0answers
7k 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
33 views

Nginx Proxy rewriting with condition for domain

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
25 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
2answers
8k views

nginx rewrite rule to convert URL segments to query string parameters

I'm setting up an nginx server for the first time, and having some trouble getting the rewrite rules right for nginx. The Apache rules we used were: See if it's a real file or directory, if so, ...
0
votes
1answer
29 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 ...
0
votes
1answer
2k views

IIS 7.5 URL Rewrite and 404 Not Found

I'm trying to setup a reverse proxy using IIS to proxy request on port 80 to a local virtual machine on port 8080. The rewriting rule was setup using IIS GUI "Reverse Proxy" rule. However it work very ...
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
vote
1answer
2k views

Nginx how to run shell script on page load via lua module os execute and then serve directory listing?

So I have a bash script that I want to execute/run on each "page load" of url so that it will modify (creating symlinks) to a /public/html/ folder that I want the server to then serve. The problem ...
-1
votes
2answers
63 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
19 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: ...
0
votes
2answers
1k views

Correct rewrite syntax to remove index.php

I got an nginx vHost that hosts: a CMS in / a magento shop in /store Things are running fine except one thing: Removing index.php from the URL. At the moment the following URLs are working ...
0
votes
1answer
1k views

URL rewrite in IIS 8.5 is not working I'm getting 404 instead

Hi I've configured a rewrite rule on my IIS but it seems like it never gets fired I've been working on this for several hours without any luck this is my rule: ...
2
votes
1answer
3k views

How to exclude a sub-folder from HTaccess RewriteRule

I have WordPress installed in my root directory, for which a RewriteRule is in place. I need to password-protect a subfolder ("blue"), so I set the htaccess in that folder as such. Problem is that ...
2
votes
1answer
29 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 ...
1
vote
1answer
24 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
8 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 ...
2
votes
1answer
1k views

nginx rewrite subdomain to file as a variable

How do you get the subdomain as a variable to add in a rewrite? hello.example.com should go to example.com/user.php?u=hello but still display as just hello.example.com I'm currently doing ...
0
votes
0answers
17 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 ...
1
vote
3answers
1k views

nginx rewrite rules: Rewrite /test/ and /test to /test.php

How do I do this? This seems to work by default in apache, but not on nginx it appears?
0
votes
1answer
383 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 ...
18
votes
10answers
26k 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
3answers
2k views

How to configure apache as a reverse proxy with the remote server specified in a query string parameter

Problem: I'm trying to configure apache as a reverse proxy where the remove server is specified in a query string parameter. Let's say I'm serving a site at mywebapp.com. If you navigated to ...
3
votes
1answer
1k views

IIS URL Rewrite - Redirect any HTTPS traffic to sub-domain

Our hosting environment dictates all secure traffic music travel over a particular sub-domain. We are using the .NET CMS Umbraco, which as far as I'm aware doesn't have any functionality to 'assign' ...
0
votes
1answer
1k views

Nginx rewrite rule - appending language prefix

I have a site spanish.com. I want users to load pages under "es" directory, i.e., spanish.com/es. For example: Users should see: spanish.com but spanish.com/es is loaded Users see ...
0
votes
4answers
9k views

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 ...
3
votes
3answers
5k views

How to redirect root to subdirectory while maintaining URL in the address bar

I have an nginx setup with folder structure like this: - www |- splash |- blog www is the root folder. I would like to redirect users who access http://example.com to the splash folder. But I ...
1
vote
1answer
24 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: ...
0
votes
0answers
6 views

Which is more SEO friendly, redirect or rewrite? [migrated]

On Apache 2.4, which is better for multiple migrated URL's in terms of SEO, 301 Redirect or rewrite? I have ~50 URL's
1
vote
1answer
53 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: ...
0
votes
1answer
3k views

.htaccess Rewriting Tomcat Server

I am writing a website using Railo. My code is to be deployed on a Railo Server running on Tomcat, overlayed on a regular Apache+PHP server. I need to send all requests to ...
2
votes
1answer
29 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
28 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
550 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
737 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 ...
0
votes
0answers
386 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
362 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
67 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
387 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 ...
0
votes
0answers
53 views

rewrite works in htaccess but not in apache2.conf

I am trying to move rewrite rules from .htaccess to apache2.conf (at Kubuntu to use The Bug Genie software). Rewrite rules in .htaccess works fine, but after moving (and adjusting) it to apache2.conf ...
4
votes
3answers
8k views

IIS URL Rewrite HTTP to HTTPS with Port

My website has two bindings: 1000 and 1443 (port 80/443 are in use by another website on the same IIS instance). Port 1000 is HTTP, port 1443 is HTTPS. What I want to do is redirect any incoming ...
10
votes
5answers
5k views

Remove “www” and redirect to “https” with nginx

I want to create a rule in nginx that does two things: Removes the "www." from the request URI Redirects to "https" if the request URI is "http" There are plenty of examples of how to do each of ...
0
votes
0answers
360 views

Cannot reset base url in apache server

I just uploaded my project on an apache server. I use angular and I set the base url in my code like <base href="/nik/awesome/"> my project is single page application, I set the routes like ...
0
votes
1answer
373 views

NGINX rewrite rule applied twice

I want to set up NGINX to serve OpenUI5 applications on development machine. I never used NGINX before, and experience troubles with rewriting URLs. As I can see from trace log, it is applied twice, ...