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
11
votes
2 answers

Tomcat 8 URL Rewrite Issues

I have got the tomcat 8 rewrite to work but seems to missing something in rewrite.config that is causing the last condition to not execute. For benefit of others, i have the RewriteValve to work for my specific application and not globally. What…
Arvind N
  • 231
  • 1
  • 2
  • 7
11
votes
1 answer

Simple IIS rewrite outbound rule is giving an error and page crashes

I try to use IIS rewrite outbound rules at the IIS where some of website have it implemented successfully. So I created a simple rule to replace the word "test" with "123456". And I am getting this error 500 - Internal server error. There is a…
NoWar
  • 36,338
  • 80
  • 323
  • 498
11
votes
7 answers

How can I create friendly URLs with .htaccess?

I'm having a hard time with .htaccess. I want to create friendly URLs for a site I'm working on... Basically I want to convert…
Jonathan
  • 8,676
  • 20
  • 71
  • 101
11
votes
2 answers

angular module.run ReferenceError: $location is not defined

I want to AngularJS Change Path Without Reloading, look http://joelsaupe.com/programming/angularjs-change-path-without-reloading/ in core.js: 'use strict'; angular.module('App',['ngRoute']) .run(['$route', '$rootScope', '$location',…
UNSTABLE
  • 393
  • 1
  • 4
  • 13
11
votes
2 answers

Wordpress - Pass Query string as slash based URL

I am trying to pass a parameter to a wordpress page. I don't want to pass it as a query string. I would like to pass as a slash based url. Example: http://localhost/mysite/pagename?user=myname into http://localhost/mysite/pagename/myname How can I…
Jack Ant
  • 201
  • 2
  • 4
  • 7
11
votes
2 answers

Can backslash be encoded correctly in URL with URL rewrite?

I am working on an ASP.NET MVC2 project. The problem is when a string which would be rewritten into URL contains a special character such as backslash or question mark, the URL will be wrong, even if I have encoded it before. For example: I have a…
Edison Chuang
  • 2,911
  • 4
  • 26
  • 28
11
votes
2 answers

Apache rewrite subnet ip range

Can someone please tell me how to put the following IP ranges (belongs to Cloudfront) in a mod_rewrite? I am looking to redirect the non-www requests for example.com to www.example.com BUT not redirect any IP address coming from IP Ranges…
Ma Diga
  • 406
  • 1
  • 3
  • 14
11
votes
1 answer

Unable to ignore mod_rewrite internal redirects with NS flag

I have defined a couple mod_rewrite rules in an .htaccess file, one to rewrite the URL path from /rwtest/source.html to /rwtest/target.html, and another to prohibit direct access to /rwtest/target.html. That is, all users wishing to see the content…
mxxk
  • 9,514
  • 5
  • 38
  • 46
11
votes
1 answer

Exclude path in IIS rewrite rule?

I have a rewrite rule that converts a URL to lowercase. I would like to exclude a folder but don't know RegEx. How do I exclude "~/myfolder" from the rule below?
TruMan1
  • 33,665
  • 59
  • 184
  • 335
11
votes
1 answer

In IIS URL Rewrite 2.0, why does HTTP_HOST include the port number?

I am trying to use IIS URL Rewrite 2.0 with IIS 8.5 on Windows 8.1. According to Accessing URL Parts from a Rewrite Rule, For an HTTP URL in this form: http(s)://:/? • The is matched against the pattern of the…
Mike
  • 7,500
  • 8
  • 44
  • 62
11
votes
1 answer

How does the new Magento1.13 EE URL rewrites work/ How do the new database tables relate to each other?

I've been playing with the Magento 1.13 code for a few hours, and I'm having trouble understanding what they have done with URL rewrites. I was hoping that someone who has looked into this could point me in the right direction. I noticed that…
Emil Stewart
  • 488
  • 1
  • 7
  • 17
11
votes
2 answers

Enable SEO URLs on multi stores and subdomains on OpenCart using Nginx

I am trying to get SEO URLs working across multi-stores in OpenCart. I have two stores in the admin http://www.shop.com (default) http://m.shop.com SEO URLs work for http://www.shop.com But they return a not_found.tpl (the 404 page) for the…
TheBlackBenzKid
  • 26,324
  • 41
  • 139
  • 209
11
votes
3 answers

Laravel .htaccess rewrite rule conversion to IIS

Laravel4 framework comes with a default .htaccess rule for create pretty urls. The rule is this. Options -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php…
Javier Cadiz
  • 12,326
  • 11
  • 55
  • 76
11
votes
1 answer

IIS7 Rewrite Map Regex?

Is it possible to use reg ex in a rewrite map? For example: Or is there a way to handle this approach? Currently, I have a rule set up to match on…
Sam Gooch
  • 131
  • 1
  • 4
10
votes
4 answers

IIS rewrite rule for basic auth on the querystring

I am trying to automatically log in users to an Xwiki install via basic auth. This is because help is stored in the wiki, but we want the retrieval process to be transparent to the user. We push the user off to a url (via an tag)…
Erin Drummond
  • 5,347
  • 6
  • 35
  • 41