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
5 answers

URL rewriting problems with ASP .NET 2 on IIS7 and Vista

I've got a website running under ASP .NET 2/IIS7/Vista. I have a URL rewriting module which allows me to have extensionless URLs. To get this to work I have configured the system.webServer section of the config file such that all requests are…
gilles27
  • 2,221
  • 6
  • 23
  • 37
3
votes
1 answer

Rewrite rules for localhost AND live environment

I want to add rewriterules that works in local environment (localhost) and on my liveserver. Why? I don't want to change rules when I test my project locally and upload it to the liveserver. Adding Rules Here an…
Fdev
  • 63
  • 1
  • 6
3
votes
1 answer

Rewriting cakephp path in cakephp 3.0

I have a need to remove the app folder from the URL. Example URL is: mydomain.com/cake_app/vechicles/add What I need to have instead is mydomain.com/vechicles/add NOTE! In the root of mydomain.com I have a WordPress installation running, so I only…
Domas
  • 1,133
  • 4
  • 18
  • 46
3
votes
4 answers

Allow chinese chracters in url rewriting

I had wrote URL rewrite Rule: But there are some Chinese characters in my URL like: 'http://www.ilanbio-international.com/News/4443/中国陕西西安---渭南验室奠基石庆典' Which is not…
Gaurav_0093
  • 1,040
  • 6
  • 28
  • 56
3
votes
1 answer

.htaccess redirect home.html to root but allow query strings

I want to 301 redirect home.html to the root to avoid duplicate content. I can do this like this: RewriteRule ^/home.html$ / [NC,R=301] However there is a legacy affiliate program that use home.html like this: home.html?a=companyname Is there a…
user1059511
  • 257
  • 1
  • 4
  • 18
3
votes
2 answers

Accessing Session in MasterPage load event after a UrlRewrite

Situation: In Web.Config we have CustomErrors turned on with redirectMode="ResponseRewrite". In Page_Load of our MasterPage we access the Session property of the Page. Problem: When an Error occurs on any page the user gets redirected (via…
Thomas
  • 2,137
  • 1
  • 17
  • 38
3
votes
1 answer

IIS reverse proxy interfering with redirect location header

I have the following rewrite rule on an ASP.Net site to get IIS to act as a reverse proxy:
caesay
  • 16,932
  • 15
  • 95
  • 160
3
votes
1 answer

htaccess rewriterule 2 parameters in url

I am having an issue with rewriting an url via .htaccess, I have the following url www.website.com/people.php?search=search via htaccess I turn it into .../people/search RewriteRule ^people/([a-zA-Z0-9]+)$ people.php?search=$1 RewriteRule…
lagro23
  • 123
  • 1
  • 6
3
votes
0 answers

WordPress Custom Taxonomy hierarchical terms rewrite

I have created a custom taxonomy URL structure that is as follows: /term_slug/post_name I have created custom rewrite rules to do this, as follows: register_taxonomy( 'blog_type', 'post', array( 'labels' => array( 'name' …
David
  • 2,365
  • 8
  • 34
  • 59
3
votes
3 answers

Where to place HttpContext.Current.RewritePath in ASP.NET 5?

I do development in asp.net. Recently I found out that in asp.net 5 there is no Global.asax file. One of the thing to put in Global.asax file is URL rewriting. With Global.asax file is gone. Where I can place URL rewriting code. I mean I do…
user786
  • 3,902
  • 4
  • 40
  • 72
3
votes
3 answers

Remove Old Permalinks?

I have a Wordpress website. I have changed my permalinks several times. All past versions of the permalinks I used are still working. If I type them into the URL bar, I am taken to the page WITHOUT the URL changing/redirecting to the new/current…
dnat
  • 65
  • 2
  • 9
3
votes
1 answer

^ character not working on mod rewrite in htaccess

I'm having this very annoying problem with my rewrite rules in the .htaccess file. The context So what I want is to have these two types of URLs rewrite to different targets: URL 1 -- http://example.com/rem/call/answer/{Hex String}/{Hex String}/ URL…
Dolma
  • 394
  • 2
  • 9
3
votes
2 answers

Remove characters from query string

I need to redirect http://example.com/page/?Id=1253-23098- to http://example.com/page/1253-23098 This redirection also includes removal of '-' from end of query string. What i've done is RewriteEngine On RewriteCond %{REQUEST_URI} …
Praveen Dabral
  • 2,449
  • 4
  • 32
  • 46
3
votes
3 answers

ASP MVC Routing with > 1 parameter

I have the following route defined routes.MapRoute( "ItemName", "{controller}/{action}/{projectName}/{name}", new { controller = "Home", action = "Index", name = "", projectName = "" } …
Chris James
  • 11,571
  • 11
  • 61
  • 89
3
votes
1 answer

Remove part of URL with RewriteRule

I need remove prefix /en from all URL, eg. www.mydomain.com/en/foo/bar/index.html -> www.mydomain.com/foo/bar/index.html I've tried with: RewriteRule ^/en/(.*) /$1 [L] or RewriteRule ^/en/\d+-(.+) /$1 [R,L] but nothing happens
stecog
  • 2,202
  • 4
  • 30
  • 50
1 2 3
99
100