Questions tagged [url-rewriting]

A URL rewrite engine is software that modifies a web URL's appearance (URL rewriting). Rewritten URLs are used to provide shorter and more relevant-looking links to web pages, to route users from obsolete URLs to replacements, or to simplify the format of the URL for human readability. The technique adds a degree of separation between the files used to generate a web page and the URL that is presented to the world.

A URL rewrite engine, part of a web server's URL-to-filename mapping engines, is software that modifies a web URL's appearance (URL rewriting). Rewritten URLs (sometimes known as short, fancy URLs, or search engine friendly - SEF) are used to provide shorter and more relevant-looking links to web pages, to route users from obsolete URLs to replacements, or to simplify the format of the URL for human readability. The technique adds a degree of separation between the files used to generate a web page and the URL that is presented to the world. It is integral in frameworks that route all URI requests through a routing script or a controller.

Useful links

  1. and its tag-wiki for some examples regarding the most widely-used implementation for the Apache web server.
  2. and its tag-wiki for an implementation for java/j2EE technology.
20479 questions
35
votes
1 answer

Nginx convert subdomain to path component without redirect

The idea is to take incoming requests to http://abc.example.com/... and rewrite them to http://example.com/abc/... That's easy enough to do with a 301/302 redirect: # rewrite via 301 Moved Permanently server { listen 80; server_name…
accounted4
  • 1,685
  • 1
  • 11
  • 13
35
votes
2 answers

What is the difference between URL Router and Dispatcher?

I want to know the difference between the URL Router and Dispatcher, because searching on the internet has some interesting things, just do not know if it's because they are similar, or because they reverse the function of each. Can anyone tell me…
YakumaruBR
  • 351
  • 1
  • 4
  • 3
35
votes
2 answers

How do I route images using ASP.Net MVC routing?

I upgraded my site to use ASP.Net MVC from traditional ASP.Net webforms. I'm using the MVC routing to redirect requests for old .aspx pages to their new Controller/Action equivalent: routes.MapRoute( "OldPage", …
The Matt
  • 6,618
  • 7
  • 44
  • 61
34
votes
10 answers

How to rewrite location in nginx depending on the client-browser's language?

How to rewrite location in nginx depending on the client-browser's language? For example: My browser accept-language is 'uk,ru,en'. When I request location mysite.org nginx must forward to mysite.org/uk
RKI
  • 433
  • 2
  • 5
  • 10
33
votes
3 answers

IIS reverse proxy with rewrites can't handle a redirect from the server we proxy to

We own server A, and on some occasions we rewrite requests to our partner on server B. In some cases server B will respond with a redirect to a completely different website, which is what is expected, let's say server C. However, when that redirect…
IISrewriteproblems
  • 331
  • 1
  • 3
  • 4
33
votes
8 answers

How i can translate uppercase to lowercase letters in a rewrite rule in nginx web server?

I need to translate the address: www.example.com/TEST in ---> www.example.com/test
Peak
  • 331
  • 1
  • 3
  • 5
33
votes
5 answers

Preserve HTTP/HTTPS protocol in .htaccess redirects

I have to redirect port 80 to 2368 in htaccess but I'd like to keep the requested protocol intact so that SSL doesn't break. I currently have this: RewriteCond %{HTTP_HOST} ^sub.domain.com$ [NC] RewriteRule ^ http://sub.domain.com:2368%{REQUEST_URI}…
secondman
  • 3,233
  • 6
  • 43
  • 66
33
votes
5 answers

Options FollowSymLinks or SymLinksIfOwnerMatch is off

I've read almost everything possible for this issue and couldn't find anything that would solve my problem. This is erorr log I'm getting: Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden:…
user1590251
  • 331
  • 1
  • 3
  • 5
32
votes
3 answers

.htaccess url-rewrite if file not exists

I must do a little trick for a site! The idea is: if a file for a required url exists then I go to that url, doing nothing more; if a file for a required url not exists, I must go to a file.php and than do something, but NOT changing the…
Kiavor
  • 476
  • 1
  • 7
  • 14
32
votes
4 answers

IIS Rewrite not working (but redirection does)

I was trying to play with URL re-writing using the Rewrite Module 2.0 but I had no luck getting it to work. What I'm trying to do is re-write all calls to web app at port 80 to other applications hosted in IIS (or maybe on different servers on the…
Kassem
  • 8,116
  • 17
  • 75
  • 116
32
votes
2 answers

Nginx rewrite rule with proxy pass

I'm trying to implement nginx rewrite rules for the following situation Request: http://192.168.64.76/Shep.ElicenseWeb/Public/OutputDocuments.ashx?uinz=12009718&iinbin=860610350635 Should be redirected…
Eazy
  • 3,212
  • 5
  • 24
  • 40
32
votes
2 answers

how do I know what version of IIS7 URL Rewrite module is installed

I created a rewrite rule in IIS7 that uses the trackAllCaptures="false" attribute in the conditions element and uses outboundRules. All works fine on my test system however when I deploy these rules to GoDaddy I get the error: Unrecognized…
blkbam
  • 548
  • 1
  • 5
  • 10
31
votes
6 answers

redirect 404 to similar urls

I have a website with stories in it. I can have multiple types of stories within multiple categories like: children romance scifi action thriler quests The stories are accessible using urls…
natalia
  • 839
  • 5
  • 12
31
votes
6 answers

This site can’t provide a secure connection (ERR_SSL_PROTOCOL_ERROR)

When I added the URL rewrite code in web.config and then publish it into azure. it will automatically redirects to https even I am trying to access website with http.
Pradeep
  • 5,101
  • 14
  • 68
  • 140
31
votes
3 answers

asp.net, url rewrite module and web.config

i'm using ASP.net with .NET 3.5 on IIS7 (Vista) with the URL Rewrite Module from Microsoft. This means, that i have a ... ... section within the web.config, but i get a warning,…
Christoph
  • 915
  • 1
  • 12
  • 23