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
23 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 ...
0
votes
1answer
749 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
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
1answer
58 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
102 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: ...
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
29 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
916 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
1k 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
758 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
718 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
75 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
737 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
59 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
9k 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 ...
11
votes
5answers
6k 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
721 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
731 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, ...
0
votes
0answers
717 views

How to configure each location point to a seprate upstream in nginx

How to configure each location point to a separate upstream in nginx? I need functionality like this. www.mysite.com --> 127.0.0.1:9900 or upstream. www.mysite.com/serviceA --> 127.0.0.1:9901 ...
1
vote
0answers
719 views

htaccess: Is it possible to ask with rewritecond if the request was already redirect? [closed]

I'm having a redirect loop and it could be solved by asking with rewritecond if this is the first time since user request, or it's jumping already. Is it posibble to know inside .htaccess? Thanks in ...
1
vote
1answer
757 views

Nginx rewrite without redirect

I want url domain.com/foo-111 to load contents from directory /bar/111 but not change url. I created a rewrite rule but instead of loading contents of proper directory, it 301 redirects to ...
1
vote
2answers
1k views

Server, Database or Code Issue? Magento backend rewrites itself with a index.php which doesnt work

I will be honest and admit my cross posting in magento.stackexchange.com but the reason is that I believe it is a server fault, and now I am looking for proof to present to my dreaded hosting ...
0
votes
0answers
699 views

Ignore certain endpoints in nginx SSL rewrite rule

I am currently redirecting all traffic on my site to https using the following rewrite rule: if ($ssl_protocol = "") { rewrite ^ https://$host$request_uri? permanent; } I would like ...
0
votes
0answers
23 views

URL redirect for a domain & URL (Window Server 2012)

I am shutting down an old intranet application, and in order to please my users, I would like to have a friendly page that tells them where they need to look instead. Another team however have ...
1
vote
1answer
22 views

Nginx rewrite to remove .php from files has no effect but to redirect to homepage

I'm trying to make a rewrite to remove .php from my URLs but so far no luck. Here's what I've got so far and then my results with this config below. location ~ \.php$ { try_files $uri/ ...
1
vote
1answer
56 views

Apache redirect some url to homepage

I am trying to implement a simple rewrite, but looks like i am doing something wrong. What I am trying to do is that I have a url blog.example.com/articles/ which gives me 404 , and other urls are ...
1
vote
2answers
40 views

Migrating rewrite rules under subdirectory from Apache to IIS

In the old Apache hosting, we had the following .htaccess file inside public_html/adm: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
1
vote
2answers
773 views

Conditionally Rewrite Email Headers (From & Reply-To) Exchange 2010

I have a client who maintains Company A (with email addresses %username%@companyA.com) and they own the domain companyB.com however there is no "infrastructure" (no Exchange server) set up ...
0
votes
0answers
15 views

lighttpd rewrite in magento

I'm currently using below code in lighttpd.conf to redirect http to https. $HTTP["scheme"] == "http" { $HTTP["host"] =~ ".*" { url.redirect = (".*" => "https://%0$0") } } ...
0
votes
0answers
14 views

Apache rewrite config stops working after migrating to new system

I need help with mod_rewrite commands. After migrating to a new server on Apache 2.4.6 my rules stopped working. Basically I need to divert all traffic to HTTPS except link that contains ...
0
votes
1answer
76 views

Nginx rewrite root to sub-folder without changing server root

I am trying to move an old app to nginx from apache but I froze on here. The /.htaccess RewriteEngine on RewriteRule ^(.*) public/$1 [L] The /public/.htaccess Options +Indexes +FollowSymLinks ...
0
votes
0answers
22 views

Application Requst Routing (ARR) proxy chain - 407 proxy requires authentication

Is there any way to provide credentials to the upstream (chained) proxy in ARR? I am using URLRewrite and ARR to reverse proxy an internal HTTP request to an Internet Site. In the corporate ...
0
votes
1answer
26 views

Nginx search query rewrite rule

Currently I have my rewrite queries like so rewrite ^/category/category-name /index.php?route=information/category-name last; This works fine for my pages that are static and i know the name to. ...
0
votes
1answer
43 views

Nginx specific rewrite [closed]

i am confused in nginx rewrite. please help me if can..Thanks you xxxx.conf #vhost-xxxxx server { listen 80; server_name xxxx.xxxx.com; root /var/www/html; ...
0
votes
0answers
26 views

Rewrite Query String to Display as Subdomain in Browser?

I have search every possible resource however, I have not been able to find the help i need so i thought i would ask here. I am not highly educated in .htaccess rewrites so please bare with me if i ...
0
votes
0answers
6 views

htaccess rewrite incoming links to new one [duplicate]

I'm having a problem with site migration and old links. Now, its not just a server migration, it was also a CMS migration. Site went from umbraco (asp.net) to wordpress. Problem is that google indexed ...
2
votes
1answer
77 views

nginx single page js app pushstate vs wordpress rewrite rules

I would like to add: /client subfolder containing backbone js app (with pushstate) /admin subfolder containing backbone js app (with or without pushstate) And when I open my http://example.dev/client ...
14
votes
4answers
27k views

nginx + PHP-FPM = “permission denied” error 13 in nginx log; configuration mistake?

I've got nginx 0.7x + PHP-FPM running under PHP 5.2.10 on one RHEL5 server, but trying to duplicate that setup under the bundled-in PHP-FPM in PHP 5.3.3 on a second server, I'm having some trouble ...
1
vote
0answers
26 views

forward proxy with URL rewrite

Apologies if this is a newbie question -- I can't believe its hard, so I must be missing something. I have an application at https://example.com/application/* . It makes use of PNGs sourced from ...
1
vote
0answers
27 views

Copy PHP website to virtual folder under IIS 8.5

I would like to make an existing PHP Website (Apache) run on a virtual folder under IIS 8.5. With the help of some nice online tools I translated the following .htaccess content: <IfModule ...
-1
votes
1answer
37 views

Nginx redirect 2 level subpaths

I have the following redirect rule: rewrite ^/path1/(.+)$ /path1/index.php?/$1 last; rewrite ^/path2/(.+)$ /path2/index.php?/$1 last; rewrite ^/path3/(.+)$ ...
0
votes
1answer
51 views

nginx rewrite link with wordpress

I have broken link on my WP blog, which is on this route www.site.com/wp-content/plugins/download-monitor/download.php?id=1 But when I want to redirect it to completly new site, my rewrite rule ...
13
votes
3answers
24k views

How to rewrite the domain part of Set-Cookie in a nginx reverse proxy?

I have a simple nginx reverse proxy: server { server_name external.domain.com; location / { proxy_pass http://backend.int/; } } The problem is that Set-Cookie response headers contain ...
1
vote
1answer
26 views

Haproxy redirect to different subdomain

I am trying to redirect one url example.com/blog to blog.example.com using haproxy. I have applied following rule: acl blog_path path_beg -i /blog/ redirect location http://blog.example.com/ code ...
0
votes
0answers
13 views

url rewrite - 2 rules, one rule triggers other rules response

I have 2 rules in play, one at server level, to check for exploits n hacks across the whole server, which if triggered redirects to a url with certain parameters which logs the info of the hack. The ...
-1
votes
1answer
31 views

rewrite after rewrite in nginx

i have: nginx server site based on joomla rewrite like this in server block location / { # Support Clean (aka Search Engine Friendly) URLs try_files $uri $uri/ /index.php?$args; } this ...
2
votes
0answers
77 views

Combined redirects in Nginx

We are using Nginx and want to reduce the number of "chained" redirects we have. So, for example: URL A - http://www.sitename.co.uk/SHOPPING-CATEGORIES/product_name redirects to its https version ...
1
vote
2answers
93 views

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 ...