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)

1
vote
0answers
22 views

mod_rewrite and double slash issue

I am getting mod_rewrite and double slash issue can you please help me out. # ProxyPass /balancer-manager ! RewriteRule /phoenix/^(.*) ...
0
votes
0answers
42 views

IIS Rewrite: Redirect HTTP to HTTPS and vice versa, but not all sites

I'm struggling with redirect from HTTP to HTTPS and vice versa. What I want to achieve is the following. Redirect all ASPX-Pages from HTTP to HTTPS with the following exception. don't redirect ...
0
votes
0answers
26 views

Apache - how to match against a variable within regex?

Trying to match a variable against another in a directive does not work: RewriteCond %{REQUEST_URI} /absolute/path/%{REMOTE_USER}/ Trying the If directive in Apache 2.4 doesn't work either: <If ...
0
votes
0answers
69 views

Nginx proxy_pass for relative paths

I currently have an Nginx configured this way. location /ui/ { proxy_pass http://ui:8888/; } This works but I'm having problems with retrieving some resources from the service, ...
0
votes
0answers
24 views

RewriteRule — how to serve file from subdirectory, but show requested URL using only .htaccess

I want to be able to switch between dev/live subdirectories without altering the URL that displays in the browser and without having to modify httpd.conf. I want https://domain.com to actually serve ...
2
votes
1answer
25 views

Something like foreach in htaccesss?

I am in this situation: url: domain/var1/var2/var3/.../varn And I want to change that url in: url: domain?v1=var1&v2=var2&v3=var3/.../&vn=varn I found this way: RewriteRule ...
0
votes
1answer
29 views

Set header based on %{REQUEST_URI}

I am trying to set a header based on the URI of a particular page. I access a page using chrome. Inspect element and see that my URI header is giving the value /bst/index.html Now in my Apache config ...
0
votes
1answer
67 views

mod_rewrite not working for apache alias

I have created a documentation wiki that i want to attach to my main site using an Alias for the virtual host. This allows me to access the wiki by going to website.com/documentation. I have ...
0
votes
0answers
35 views

Simple URL Redirection in IIS

I've made the following rule in the web.config in the wwwroot folder: <rewrite> <rules> <rule name="umo to google" patternSyntax="Wildcard" stopProcessing="true"> ...
0
votes
1answer
153 views

Nginx config for Magento subfolder multistore

I'm moving from subdomain to subfolder. I have multiple subfolders for several countries. I changed the domain in the Magento administration. But the Nginx rewrite doesn't seem to work. I have 1 ...
1
vote
1answer
109 views

Nginx Config Location Regex With Language Code In Url

Trying to achieve constant language code in url's 1st segment with nginx regex location configuration and could not find the correct syntax. Necessary result: example.com stays example.com ...
0
votes
1answer
27 views

Redirect 404 to parent category

If a user hits a 404 I'd like the user to be redirected to the parent category. The expected behaviour I'm looking for is the following examples www.test.co.uk/category/product404page > ...
0
votes
0answers
25 views

implementing friendly urls on an nginx-ubuntu server

Currently my website's url are like this: https://www.mywebsite.com/fx/?category-name=abc (category page) https://www.mywebsite.com/fx/?category-name=abc&article-name=xyz (article page) The ...
0
votes
1answer
42 views

Redirect 404's within a certain directory to index.php

I'm trying to redirect all 404 messages to the index page, but only within certain directories/categories. For example 404's within the following dir's will display as normal www.foo.com/ ...
0
votes
0answers
12 views

Rewrite Rule from sub directory web root [duplicate]

I want to make a one time change to my website URL structure. I want to rewrite URLs from /2015/11/sample-post/ to /sample-post/ - I don't care about the existential dilemmas caused by such a ...
1
vote
1answer
45 views

Nginx always rewriting to ssl even on non ssl sites

I have a page example.com, which has ssl certificates setup and everything is working fine. Here is the ssl part of the config: server { listen 80 default_server; server_name www.example.com ...
1
vote
1answer
50 views

Apache rewrite rule to iis

I am trying to move site on apache to iis 8.5 All is ok, but 1 rule failes my site to run properly RewriteCond %{REQUEST_URI} !\.(js|css|jpg|jpeg|gif|png)$ [or] RewriteCond %{REQUEST_URI} ...
0
votes
1answer
13 views

How do I prevent RewriteRules conflicting

I have three RewriteRules I am trying to implement but I cannot get all 3 to work together: RewriteRule ^products$ http://%{SERVER_NAME}/en_ca/products [L,R=301] RewriteRule ^products/(.*)$ ...
0
votes
0answers
87 views

nginx url rewriting , file not found, codeigniter

I have this line in my config nginx file location / { try_files $uri $uri/ /index.php; } but this request always triggers a not found error: example.com/file.php how can I catch this ...
1
vote
1answer
9 views

IIS Rewrite using IIS Manager

Hi there I am attempted to do a proper IIS rewrite utilizing the IIS manager credentials my hosting provider has given me. I have no experience with this and the articles I have read online so far ...
0
votes
0answers
30 views

nginx redirect all URI requests with query strings/arguments to the equivalent without

I was reading around about removing query strings/arguments from all requests by way of redirection like $1?$argument to just $1. I tried what the documentation said in adding a ? to the end of the ...
0
votes
0answers
10 views

Multiple domains pointing to one server. Using a rewrite rule to set preferred domain

I just launched a new website for a client. As part of the new launch I want to try and sort out their domains. Currently they have 3 domains all pointing to the same server which is bad when it comes ...
0
votes
1answer
19 views

How to redirect to different domains based on if there is any text after .com/?

I have some basic competency here, I can do one of these or the other, but cannot figure out how to do both: If a user goes to www.example.com/anydatahere, I need to pass the anydatahere to a purl ...
0
votes
0answers
29 views

Translating DNS Server Replys because of multiple NAT Networks

I am planning and building a large infrastructure wich different natted networks. Lets say I have a datacenter network 10.0.0.0/24 and I have many different customer networks that could be anything ...
0
votes
1answer
36 views

nginx: How do I redirect all requests to the frontpage?

I am shutting down a website and am stumped on a really simple problem; I need to redirect all URLs to the homepage (except, obviously, the homepage itself). I thought this should work, but it causes ...
1
vote
0answers
54 views

Nginx url rewrite stops going through location code

I'm trying to configure my Phalcon (php framework) project on Nginx. Unfortunately I can't manage to make the rewrite work. In order to better understand my problem please check out the config file: ...
1
vote
1answer
49 views

Wrong or misconfigured rewrite by nginx 1.8

I have the 2 nginx's conf files ssl.conf and default.conf under /etc/nginx/conf.d/. The first file handles incoming http request. It rewrites the http request to https. And the ssl.conf file handles ...
0
votes
1answer
79 views

Joomla “pretty urls” with nginx allow index.php/pretty/url as well as index.phppretty/url (notice the absence of slash)

I am trying to install my first LEMP stack and, after a lot of hours and reading, it's working pretty well (Damn, the www-data group write permissions issue was a tough one). Anyway, my Joomla site ...
2
votes
1answer
90 views

Apache RewriteRule 502 Error on dev server, works on live

I'm on Apache 2.2.15. My vhost.conf contains a RewriteRule to handle article URLs; # handling for neat article titles RewriteRule ^/news/[0-9]{4}/[A-za-z]{3}/([0-9a-zA-Z-]*)/([0-9]{4})([0-9]{6})/?$ ...
0
votes
0answers
68 views

Rewrite /a/1/2 to /a.php using Nginx

I'm taking over a really old app and migrating it from apache to nginx. What I currently have. This works: # catch specific paths, rewrite to first segment # /a/1/2 => a.php # /b/3/4 => b.php ...
0
votes
1answer
20 views

Redirect loop in apache rewrite rules

I am trying the following redirect rule, but it ends in redirect loop. Is there any way to avoid it? There are multiple domains and based on the file accesses respective file should be served from ...
-1
votes
2answers
22 views

Rewrite domain to cut its URI [duplicate]

I need to set up the domain.com/wp1/ to be shown like domain.com/ I have tried to set up any rewrite in the past hours, but no success :( P.S. There is a wordpress installed in the public_html/wp1, ...
1
vote
0answers
72 views

How to SOAP over a proxy server I own(configuration)?

I have a server called http://SERVER-A.com which sends a SOAP request to a third-party address. Also I have another server called http://Server-B.com which I want to configure as a proxy server. I ...
1
vote
0answers
19 views

Make Varnish check for html static before serving

I was thinking of writing some logics to my application so that it can write the static page content to s3 or some CDN and serve primarily from there. But am not sure if this is possible. For ...
0
votes
0answers
41 views

IIS7 (Azure) HTTP -> HTTPS redirect fails with certain query strings

These are how my rules are setup for a NodeJS application running on Azure: <rewrite> <rules> <clear /> <rule name="Force HTTPS" enabled="true" ...
-3
votes
2answers
31 views

apache conf entry does not work but does in .htaccess [closed]

i am running: Server version: Apache/2.2.15 (Unix) i have a custom security conf file on a shared server. i placed the following entry at the top of the file with no joy, and i also placed it at ...
1
vote
2answers
37 views

Postfix rewrite recipient based on domain

I'm looking for a postfix configuration to create recipient rewrite rules based on the recipient domain name including catch all for domains not found in the "not rewrite"-list. For example: ...
0
votes
0answers
34 views

Nginx convert URL to path on server

I have a problem with converting URL into path to file. For example. I want open file /var/www/html/dir1/dir2/dir3/file_one.conf in browser by link http://domain.com/dir1.dir2.dir3.file_one ...
-1
votes
1answer
53 views

Converting .htaccess rule to nginx not working

.htaccess rules: RewriteEngine On RewriteCond %{QUERY_STRING} (.*) RewriteRule ^yon-(.*).mp4$ index.php?videodata=$1&yonlendir=true&%1 [NC] RewriteCond %{QUERY_STRING} (.*) ...
0
votes
1answer
22 views

How is leading slashes handled in server and in client?

I am trying to create a RewriteRule, but it's unreliable and I can't figure out what is happening. Here's my rule: RewriteRule ^docs/(......)/$ index.php?docid=$1 [L] the problem is leading ...
1
vote
1answer
168 views

NGINX URL with parameter rewrite to URL without parameter

I have an NGINX background on my server. I cannot figure out why my rules doesn't work. How can I redirect or rewrite it so I could open URL with the same content, for example: ...
0
votes
2answers
59 views

Nginx URI redirect (regular expressions)

I plan to rename one of my site's menu and I'll need to catch the old SEF urls and rewrite them to the new ones. One portion to change is in the middle of URL (old to new) and the other is at the end ...
0
votes
0answers
8 views

combining 2 rules into 1 to account for .aspx extension

I have 2 re-write rules in IIS7 to account for a url with or without .aspx extension. <rule name="Product .aspx" stopProcessing="true"> <match ...
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] ...
1
vote
2answers
149 views

nginx -> serve different files using try_files based on cookies (conditions, if, then, else)

I need to configure an nginx server so that: If user has a specific cookie so the server must send a file, else the server must send another one. I read plenty of related articles, but nothing helped, ...
-1
votes
1answer
29 views

What is the Ideal way to spoof files in nginx (alias, try_files or rewrite)

I'm trying to spoof file location by sending long url to the server, the server translate it to the proper php file and return the result, example: I send a link like this: ...
-1
votes
1answer
66 views

nginx rewrite based on args

got links on old site like /aaaa/bbbb/cccc.php?SECTION_ID=112233 So i need redirects based on value of SECTION_ID for example /aaaa/bbbb/cccc.php?SECTION_ID=112233 leads to /aaaa/cccc/, but ...
0
votes
0answers
92 views

How to haproxy rewrite http header

I have 1 haproxy server hosting for website.com and 1 nginx server hosting for static.website.com . I want when haproxy receive http request for http://website.com/static/image.jpg it will rewrite: ...
0
votes
1answer
25 views

nginx regex rewrite rule for images

I have the following URLs: www.example.com/data/images/13122013-002_IM1621.jpg www.example.com/data/images/13122013-002_IM1622.jpg www.example.com/data/images/13122013-002_IM1622.jpg On the file ...
0
votes
0answers
102 views

Appending URL subdomain as URL path in HAProxy

I want to convert following URL: http://subdomain.example.com/a/b/c To this: http://example.com/subdomain/a/b/c In HAProxy. Thanks a lot