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

Url Rewrite in Self-Hosted environment

I have a SignalR-service in two api-versions running in self-hosted Owin processes. I want to route traffic for api.service.com to either api1.service.com or api2.service.com depending on a http-header (api-ver) in a request. Is this possible to do…
Andreas Zita
  • 7,232
  • 6
  • 54
  • 115
3
votes
2 answers

Rewrite sub-domain to directory

I'd like to map subdomain.example.com to www.example.com/subdomain using an internal URL rewrite that looks at the host name and simply forwards any request to a subdirectory with the same name as the subdomain. Thanks for your help
krisdyson
  • 3,217
  • 7
  • 43
  • 86
3
votes
1 answer

Rewrite GET Query String using .htaccess

I want to Rewrite my GET Query String from this - http://www.example.com/verify.php?key=547b52f2b5d20d258e62de1e27b55c to this http://www.example.com/verify/547b52f2b5d20d258e62de1e27b55c I am using the following rule but it does not seem to work…
user4298677
3
votes
1 answer

Want 'example.com/home' to show as 'example.com' in address bar

The content for my home page is pulled based on a query to the database using the slug 'home'. For example, if I enter example.com/home in the address bar, it queries the database based on seeing '/home' and pulls the correct content (using a…
hamilton9
  • 33
  • 4
3
votes
1 answer

scala & lift: rewriting URL using variable declared outside LiftRules.statelessRewrite.append

I'm looking for a solution for rewriting URLs in lift using a list declared outside the scope of LiftRules.statelessRewrite.append LiftRules.statelessRewrite.append { case RewriteRequest(ParsePath("abc" :: Nil, _ , _ , _ ), _ , _ ) => …
Kamil
  • 33
  • 3
3
votes
2 answers

How to change localhost url for Laravel

Maybe a pretty basic question but I want to know that how I can change my localhost URL for larvel from localhost:8000 to something.com. I searched but I found solutions for xampp and wamp which does not apply to laravel I think.
StealthTrails
  • 2,281
  • 8
  • 43
  • 67
3
votes
1 answer

Mod Rewrite rule to Zeus Server rule (Codeigniter)

I'm about to go live with a Codeigniter powered site. I want to remove index.php from the url so that instead of this: http://www.mysite.com/index.php/controller I get something like this: http://www.mysite.com/controller So far, pretty…
John McCollum
  • 5,162
  • 4
  • 34
  • 50
3
votes
1 answer

Access GET variables with PHP + .htaccess

I'm developing a website using PHP. My .htaccess has this rewrite rule: RewriteEngine On RewriteRule ^book/([^/]*)\.html$ book.php?title=$1 [L] So the URL that looked like: www.example.com/book.php?title=title-of-the-book turns into…
rlc
  • 5,809
  • 5
  • 38
  • 46
3
votes
1 answer

www to non-www redirection won't work

I'm writing a www to non-www redirection with the following code: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] However, www.mywebsite.com redirects to mywebsite.com/www/ instead…
Matthew
  • 31
  • 4
3
votes
1 answer

Apache mod_rewrite

I'm using Liferay 6.2 EE that runs on tomcat but it's fronted by an Apache server. I want to redirect users so that whenever they hit the old liferay URL, it redirects them to the new liferay URL. I changed the URL in liferay, so it is now the new…
Samantha
  • 91
  • 9
3
votes
1 answer

IIS Rewrite Rule - How to include root documents

I have a simple IIS rule to redirect HTTPS to HTTP:
4532066
  • 2,042
  • 5
  • 21
  • 48
3
votes
1 answer

URL Rewrite Module, Azure and web.config

I'm trying to use the URL rewrite module in Azure but for some reason I can't add a section to the web.config's system.webServer section (as shown on http://msdn.microsoft.com/en-us/library/dd573358.aspx). I've installed the URL Rewrite…
Louis S. Berman
  • 994
  • 1
  • 9
  • 25
3
votes
1 answer

Fetching the URL parameters with PHP after IIS URL rewrite

I have a PHP website, e.g. http://www.test.com/rewrite-test/s/z2SZhBL This was previously on Apache which had a rewrite rule to trap the "z2SZhBL" using the $_GET['id']. RewriteEngine on RewriteRule ^([^/\.]+)/?$ /index.php?id=$1 [L] I need to…
davesherlock
  • 185
  • 1
  • 1
  • 9
3
votes
1 answer

Phalcon, IIS, Rewrite

I am currently running Windows Server 2012 R2 with IIS 8.5 and Phalcon 2.0.8 running on PHP 5.5. I have a rewrite rule (using the basic .htaccess file that was imported from Phalcon) and the rewrites work fine. However, I have created a system…
ACBobby
  • 31
  • 3
3
votes
2 answers

HAProxy and reqrep path rewriting with redirect configuration

With HA Proxy 1.5 I need to rewrite URL from http://main.domain.com/my-foo to http://othersite.com:8081/other-bar Here is what I tried: frontend ft_def bind :80 mode http …
djool
  • 48
  • 1
  • 4
1 2 3
99
100