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

mod_rewrite with previous rule affecting other rule

I have the next RewriteRule for being able of access to domain.com/section/products/whatever from the folder called _products. The original URL looks like this: domain.com/section/_products/product.php?param=whatever This is that…
Jimmy Adaro
  • 1,325
  • 15
  • 26
3
votes
0 answers

Redirect POST request to another url:port while retaining its data in IIS Server

I want to redirect the POST request to another url:port with POST data intact but when i am trying to do it IIS server is issuing GET request and losing the data. The web.config action method is as follows :-
Mani
  • 508
  • 1
  • 7
  • 18
3
votes
1 answer

Javascript: redirect to different Subdomain

I've got a Landingpage: "https://www.example.com" and an Application: "https://app.example.com/something/" and on some user actions like logout i need to redirect the user back to the original landingpage. my hard-coded solution does…
ahe
  • 128
  • 1
  • 9
3
votes
1 answer

Subdomain Setup for IIS pointing to the same web application

We have a web application which must be deployed as independent subdomains to the url http://clientName.webapp.com. Each client can choose a site name, but the web application are all the same. We are currently running .NET 2.0 moving to 3.5 on…
Yang
  • 31
  • 3
3
votes
1 answer

Change custom post type url/slug in wordpress?

i want to change my custom post url/slug from "property" to "project". From this https://ayanaproperties.com/property/chelsea-creek-development-sw6-london/ To this https://ayanaproperties.com/project/chelsea-creek-development-sw6-london/ what…
Sajjad Ahmad
  • 143
  • 3
  • 17
3
votes
1 answer

shortening url to cms

Hi We have a CMS application that lets people create websites under our domain. The system was built a few years ago and it used a method that transfers parameters such as website id, folder code and more using the url. this method created a giant…
peroxide
  • 696
  • 1
  • 4
  • 19
3
votes
1 answer

Redirect HTTP > HTTPS when port is always 80

Our application needs to redirect HTTP requests to HTTPS. Normally i would use the RewriteCond as below. RewriteCond %{HTTPS} off The thing with our current hosting company is that the requested port is always 80. It doens't matter if we send a…
S.Pols
  • 3,414
  • 2
  • 21
  • 42
3
votes
2 answers

URL Rewrite in ASP.NET 3.5 and IIS 7 using HTTP Module

I am developing an application in ASP.NET 3.5 and IIS 7. I have written an HTTP Module to perform URL Rewrite, for instance, I want to rewrite a username to an Account ID "~/Profiles/profile.aspx?AccountID=" + account.AccountID.ToString(); See…
Walter Lockhart
  • 1,293
  • 3
  • 20
  • 34
3
votes
1 answer

mod_rewrite: Check for Custom query string in URL?

I'm trying to use URL rewrite in my new project. But I also need to allow custom query sting in URL. I just want to know how to write rewrite rule for this URL http://www.mysite.com/edit/123/?q1=value1&q2=value2 to become…
Ei Maung
  • 7,013
  • 5
  • 23
  • 23
3
votes
1 answer

Rewrite to Subdomain from Domain Pointer

I have a domain (www.example.com) with a subdomain (test.example.com) I also have a domain pointer (www.pointer.com) pointing to www.example.com What I would like to do is have anybody who types in www.pointer.com in the browser view…
Allen
  • 722
  • 4
  • 13
  • 31
3
votes
1 answer

Using try_files alongside rewrite in nginx location block

I already make extensive use of rewrite in nginx to perform this sort of thing: /photos/123344 -> /photos/photos.php?id=123344 /photos/london-2016 -> /photos/photo-shoot.php?name=london-2016 Currently I have no rule for…
Codemonkey
  • 4,455
  • 5
  • 44
  • 76
3
votes
3 answers

Making a 301 rewrite from within a folder using relative rewrite URLs

I have the following problem. We used many different URLs to the same page. Now we want to use only one URL for those pages. Here an example: RewriteRule ^(subfolder1/folder1/|(subfolder2|subfolder3)/folder2/|folder3/)?(name1|name2|name3|name4)$…
2ndkauboy
  • 9,302
  • 3
  • 31
  • 65
3
votes
2 answers

Using httpd ProxyPass with DirectoryIndex

How can I use a ProxyPass and DirectoryIndex at the same time? I have the following rule: # Index DirectoryIndex index.html # Service Endpoint ProxyPass /endpointA http://127.0.0.1:wxyz/ ProxyPassReverse /endpointA http://127.0.0.1:wxyz/ # Root…
Matt Clark
  • 27,671
  • 19
  • 68
  • 123
3
votes
2 answers

Using Htaccess files on iis (windows 10)

I cannot find any information on how to perform URL Rewriting on IIS (windows 10). I develop websites on windows but have a linux server which uses a htaccess file for URL Rewriting. The issue here is, I find it far too time consuming to manually…
NAMAssist
  • 321
  • 1
  • 4
  • 14
3
votes
3 answers

Rewrite dynamic pages AND non-www to www (.htaccess)

Ok, so I have a page.php placed on www.example.com/test that I want to rewrite to www.example.com/test/page/id ( from www.example.com/test/page.php?page=id ) I added this simple .htaccess and everything's fine so far Options…
messinismarios
  • 180
  • 3
  • 12