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

Using RewriteCond with %{REQUEST_URI} for mod_rewrite

I would like the URL: http://domain.com/category/subcategory/title To point to: http://domain.com/posts/category/subcategory/title.php My .htaccess file looks like this: RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME}…
Craig
  • 2,093
  • 3
  • 28
  • 43
3
votes
1 answer

How to get the "originally requested" URL when using IIRF URL Rewriting Engine

I am using Iconic's IIRF URL Rewriting Engine on IIS and the "fancy" URLs are something like this: http://some-website.com/some-function/418/some-keyword-rich-filename.html This example URL corresponds…
Salman A
  • 262,204
  • 82
  • 430
  • 521
3
votes
1 answer

How to rewrite base url in django to add logged in username in the url of all pages instead of app name?

I am working on django application and I have base url of application as below: 127.0.0.1:8000/myblog/page where 127.0.0.1:8000 is base url and myblog is App name and page is page name. So my requirement is to change the url to something like this…
Always_a_learner
  • 4,585
  • 13
  • 63
  • 112
3
votes
0 answers

URL rewriting is not working on live server in php

I have a URL that looks like: DomainName/admin_panel/messages.php?order_id=7&to_id=7 I want to convert this URL to: DomainName/admin_panel/messages I have create a .htaccess file like below but it's not working on live server as well as on…
junaid afzal
  • 75
  • 1
  • 2
  • 10
3
votes
1 answer

Tomcat 9 Rewrite with ORDS and Oracle Apex

How to set URL Rewrite (like mod_Rewrite in Apache) with Tomcat (8.x, 9.x - which supports rewrite natively ) and ORDS and Oracle Apex (with no Apache in front)?
3
votes
1 answer

Nginx disable url rewrite for specific path / url

I have the following nginx configuration for the url rewrite location / { ##merge try_files $uri $uri/ /index.php?q=$uri&$args; } location /devtools/phpmyadmin/ { ##merge root /var/www/domain.tld/web; location ~ \.php$ { …
wpdaniel
  • 714
  • 8
  • 25
3
votes
2 answers

How to redirect url with parameters in nginx

for example, i want to redirect from https://www.example.com/${pid}.txt to http://www.anotherExample.com/api?pid=${pid} how to configure it in nginx? Thanks in advance:)
Ning Lv
  • 35
  • 1
  • 5
3
votes
9 answers

What is a good way to have a SEO URL system built up in PHP?

I want to have "pretty" and SEO oriented URLs in my site. I've build up my own tiny framework for this site and almost everything is complete now. One thing I'm still puzzled up is the pretty/SEO URLs system that I will use. I know there's many way…
AlexV
  • 22,658
  • 18
  • 85
  • 122
3
votes
1 answer

Configure Nginx to ignore a path in url

My website is at /root/website/, in it there is a folder static for static files, when the user visit: /static/dfd99a5/xxx.js, I wish to serve /root/website/static/xxx.js, how can I do this in nginx?
3
votes
3 answers

ASP .Net: Authorization issue

I am having some trouble when I use ASP .Net 4's URL Routing feature while Authorization rules configured. Global.asax void Application_Start(object sender, EventArgs e) { RegisterRoutes(RouteTable.Routes); } private void…
Moon
  • 33,439
  • 20
  • 81
  • 132
3
votes
1 answer

Apache ignoring rewrite rules when using mod_proxy

I am trying to get Apache to rewrite the URL based on certain conditions but it is failing. I have tried searching for the answer but have come up empty handed. We are using Apache as our webserver and proxying the requests to Tomcat for using our…
Yamaha32088
  • 4,125
  • 9
  • 46
  • 97
3
votes
2 answers

Arrangement, Skipping and URL re=writing

I tried to re-write on my own but unable to do so, basically, I want to re-write php-based URL with .htaccess but also need to skip few parameters of php URL for example; Original…
3
votes
2 answers

Url Rewrite Provider on Azure Web App

We use the DbProvider from the URL Rewrite Extensibility Samples for allow our rewrite rules to use db values. I'm trying to move this website to an Azure Web App. After deploying to a Windows Azure Web App, I'm getting this error: HTTP Error 500.50…
3
votes
2 answers

IIS URL Rewrite subfolder to another folder name

I have a question, how I can achieve the following result by creating a URL-Rewrite Rule. On wwwroot, I have the folder wordpress/demo that is accessible on e.g. www.example.com/wordpress/demo. However, I want to make this page accessible under…
DS87
  • 536
  • 3
  • 9
  • 29
3
votes
1 answer

Use both rewrite and php-fpm for .php extension in nginx

I am trying to migrate to Nginx + PHP-FPM from Apache + mod_php. I am currently using mod_rewrite to rewrite some virtual URIs ending in .php to actual PHP scripts. This works perfectly when using mod_php. But with with Nginx + FPM, since we have to…
Joyce Babu
  • 19,602
  • 13
  • 62
  • 97