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
13
votes
1 answer

OpenCart on nginX

Can OpenCart use SEO URLs on nginX? I understand that in Apache, it creates an .htaccess, but is it capable of automatically managing the URL redirection in nginX?
OC2PS
  • 1,037
  • 3
  • 19
  • 34
13
votes
3 answers

RewriteCond to match query string parameters in any order

I have a URL which may contain three parameters: ?category=computers &subcategory=laptops &product=dell-inspiron-15 I need 301 redirect this URL to its friendly version: http://store.example.com/computers/laptops/dell-inspiron-15/ I have this but…
TrueBlue
  • 480
  • 1
  • 4
  • 9
12
votes
3 answers

Capturing a Value in a Cookie using URL Rewrite for IIS7

I need to write a URL Rewrite rule for my IIS 7.5 website that captures a value in a particular cookie, and then uses that value to construct a URL. For instance, the incoming requests looks like this: GET http://myserver.com/test.aspx…
Geoffrey McGrath
  • 1,663
  • 1
  • 14
  • 35
12
votes
3 answers

Missing CSS file and images after URL rewrite

I'm trying to make user friendly URL using mode rewrite. My problem is, that after giving category like 'name' to my URL, when I call the page using new URL, it can't load the CSS file or images. I have a link…
max
  • 3,614
  • 9
  • 59
  • 107
12
votes
2 answers

HAProxy and URL Rewriting Configuration

I would like to ask how HAProxy can help in routing requests depending on parts of the URL. To give you an overview of my setup, I have the HAProxy machine and the two backends: IIS website (main site) Wordpress blog on NGINX (a subsite) The…
Ianthe the Duke of Nukem
  • 1,721
  • 2
  • 20
  • 37
12
votes
1 answer

IIS7 URL Rewriting to different domain, exact match

I basically want to match the exact address http://www.example.com/mysite and redirect it to http://www.example2.com/something/something If possible I want to be able to do it with IIS because I have coded an internal rewriting module for…
James Hay
  • 7,115
  • 6
  • 33
  • 57
12
votes
5 answers

Can a PHP file name (or a dir in its full path) have UTF-8 characters?

I would like to access a PHP file whose name has UTF-8 characters in it. The file does not have a BOM in it. It just contains an echo statement that displays a few unicode characters. Accessing the PHP page from the browser (FireFox 3.0.8, IE7)…
Raleigh
  • 408
  • 1
  • 3
  • 9
12
votes
5 answers

Rewriting URLs in ASP.NET?

I am using ASP.NET C#. How do I implement URL re-writing procedure that is similar to StackOverflow.com? http://stackoverflow.com/questions/358630/how-to-search-date-in-sql Also, what is the meaning of values such as "358630" in the URL? Is this…
djmzfKnm
  • 26,679
  • 70
  • 166
  • 227
12
votes
0 answers

How to add a header to an IIS URL Rewrite redirect action?

I'm trying to get a site ready for HSTS preload and one of the requirements is that the root domain also support HSTS. I'm serving pages at "www." so I need to redirect from the root domain to the "www." subdomain. Since this is a static site hosted…
daveaglick
  • 3,600
  • 31
  • 45
12
votes
6 answers

Enable human readable URL's in .htaccess

Preface: Yes this question seems like duplicated, and I found related questions, but answers from there didnt help to me. :( Hello, I want to add human readable URL's support for my PHP project. For now my URL quesry string looks…
nowiko
  • 2,507
  • 6
  • 38
  • 82
12
votes
3 answers

Prestashop backoffice works but the frontoffice doesn't. The url is not found

I have developed a multilanguage prestashop store completely in localhost using xampp in mac and it works. Both the backoffice and the store (frontoffice). After that, i have deployed it to amazon but there comes my problem. The backoffice works but…
Leonardo Lanchas
  • 1,616
  • 1
  • 15
  • 37
12
votes
0 answers

ASP.NET Postback error under Reverse Proxy with IIS 8.5, URL Rewrite 2.0 and ARR 3.0

I would like to setup a reverse proxy in IIS but in my configuration I get problems with ASP.NET postbacks. When you click on any submit button of the proxied website then you get a 404 error. The URL in browser address bar is changed to the…
lekso
  • 1,731
  • 3
  • 24
  • 46
12
votes
1 answer

URL Rewriting in .Net MVC

I'm wondering what is the best way to handle URL in MVC. For example, in my application I have a PageController can link to /website/Page/Index/3 or /website/Page/home. The menu is built dynamically with Html.ActionLink() and T4MVC based on the…
VinnyG
  • 6,883
  • 7
  • 58
  • 76
12
votes
4 answers

.htaccess 301 redirect for all https to http EXCEPT ONE PAGE

Here is the code I have currently in my .htaccess file: Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} ^example.com [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] RewriteEngine On RewriteCond…
dell116
  • 5,835
  • 9
  • 52
  • 70
12
votes
1 answer

How to append query string & value via IIS rewrite rule?

I'm running IIS 7 with the offical rewrite rule module installed. I'd like to create a rewrite rule to match this URL: http://www.sample.com/en-us/test.aspx?q=keyword After rewriting the expected result would be:…
Lei
  • 690
  • 1
  • 7
  • 13