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

URL rewriting in Jetty 9.3.6 with RewriteRegexRule and ResourceHandler

I am trying to get jetty and angular 2 to work together. For that I need the server to rewrite all index.html/... urls to index.html My configuration is like this: Server server = new Server(8080); HandlerCollection handlerCollection = new…
Siggi Grünwald
  • 61
  • 1
  • 1
  • 4
3
votes
1 answer

Rewriting URL without the user seeing it

I try to add a rule to my htaccess to make it possible for me to route all article urls to be loaded by the same file. Input: localhost/Project/article/my-test-article Output: localhost/Project/article.php?id=my-test-article I'm currently using…
Ledii
  • 261
  • 1
  • 3
  • 13
3
votes
1 answer

IIS URL Rewrite issue with Tilde (~)

I have some legacy URLs that I need to redirect that have a tilde (~) as part of the URL. I'm having some issues getting the IIS Rewrite rules to work. OLD URL: http://www.example.com/~/media/something/whatever.pdf Need it to redirect…
3
votes
1 answer

Replace URL pattern with 4 numbers after word

How to replace: domain.com/e-books/1234-etc By: domain.com/artigos/1234-etc I'm trying: RewriteRule ^e-books(\d{4}-.*)$ /artigos/(\d{4}-.*)$1 [R=301,L] EDIT: And this: RewriteRule ^e-books(\d{4}-.*) /artigos/$1 [R=301,L]
user882670
3
votes
1 answer

How to change custom post type slug in wordpress

I install edd plugin and add products. When I click on a product for single page or click any edd category the link generated http://site_url/downloads/category/recent-issues/ by plugin. Now I want to change the slug of post…
deemi-D-nadeem
  • 2,343
  • 3
  • 30
  • 71
3
votes
3 answers

How in magento add manufacturer in the URL of the product?

How can I change magento so that: {site}/category-name/sub-category/product-name becomes {site}/category-name/sub-category/manufacturer/product-name Where is the standard Magento manufacturer attribute? Thanks :)
Miki
  • 31
  • 3
3
votes
3 answers

Apache htaccess spanish accent

I have a problem with a redirect rule that doesn´t work with spanish special characters. I dont know how can i convert my word to type into the htaccess file, because the charset supported by htaccess file doesn´t recognice de Á, É, etc characters.…
3
votes
1 answer

RewriteRule for unknown directory

So I'm trying to get a mod_rewrite rule to redirect requests to a php-script with an .htaccess file. The thing is, I want it to work regardless of where I put the project on a webserver (the .htaccess file and the php-script are always in the same…
MoritzLost
  • 2,611
  • 2
  • 18
  • 32
3
votes
1 answer

Why is URL rewriting not working in tomcat 8 when I proxy pass URLs using nginx

Tomcat 8 URL rewrite is not working when requests are proxy passed from nginx server. But the same url-rewrite is working when requests are directly served from tomcat server. I am having nginx server listening to 80 port and tomcat server…
3
votes
2 answers

Remove folder names from the URL using htaccess

I am stuck in here with htaccess. I've searched and tried many tutorials and problem solutions but couldn't achieve what I want. I want to remove folder names from the website link. My htaccess file is in the root directory i.e "testing" What my…
Zain SMJ
  • 1,492
  • 7
  • 19
  • 33
3
votes
2 answers

How to remove empty parameter or parameters anywhere in URL by .htaccess?

Empty parameters that I mean can be anywhere in URL each time different place, each time with different name, each time on different php page e.g : http://www.example.com/AnyPHPpageHere.php?parameter1=7¶meter2=¶meter3=blue¶meter4= to…
Kevin Smith
  • 111
  • 7
3
votes
1 answer

VirtualHost : php_value enable_post_data_reading Off : for ONE webpage

I'm trying to manually parse one page on my website with multipart form data sent from a Java application. All the pages are served inside the index file in the public_html directory, and my classes for my other pages rely heavily on $_POST data…
3
votes
4 answers

Hide .php extention from urls with query string

I am using .htaccess file for url rewriting . I've written all pages with .php extention and to hide them i am using this code RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L]` But this hides when i write…
Share fun
  • 177
  • 1
  • 2
  • 14
3
votes
1 answer

Response.Redirect on Page with Url Rewritten by IIS Url Rewrite Module

I am using the IIS Url Rewrite module to rewrite urls for my ASP.Net web application. The Urls are being rewritten from: http://domain/version/page.aspx to http://domain/company/page.aspx And it works just fine when browsing directly using absolute…
CleverPatrick
  • 9,261
  • 5
  • 63
  • 86
3
votes
1 answer

wp_rewrite returning null in plugin settings page

I just wanted to add this as a SOLVED question because it took me a while to figure it out and there was no documentation on this. Notice: Trying to get property of non-object in /srv/www/wordpress-default/wp-includes/post.php on line 3555 Trying…
Nick B.
  • 41
  • 6