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

Customize URL for each user in Angular 2

I want to see an user's username as part of URL. For example: I have an URL like this: www.undefiend.com/panel/dashboard I want to customize it for every user. Like…
Ebleme
  • 287
  • 2
  • 13
3
votes
1 answer

What is the proper way to add rewrite rules in an Azure App Service

I want to add re-write rules to my Azure app service, but if I even try create a web.config with a simple rewrite as shown below, the site returns an HTTP 500.
3
votes
0 answers

Tomcat Re-write rule with AngularJS gives 404 on browser refresh

I am using Tomcat 8.5.11 running a REST end-point and AngularJS. The REST end-point has /api as the url, however, AngularJS as multiple urls (obviously). When I copy and paste or on browser refresh the url (e.g. localhost/user). I get a 404…
JHS
  • 7,761
  • 2
  • 29
  • 53
3
votes
2 answers

Simple IIS 7 regex with optional 1, 2 or 3 values

I'm trying to make a regex match the following URL: www.mydomain.com/newyear/food/maincourse/ and have it rewrite to default.aspx?occasion=(newyear)&type=(food)&category=(maincourse) It works fine…
kasperwf
  • 277
  • 2
  • 4
  • 16
3
votes
0 answers

Nginx url rewrite uppercase to lowercase

is there a way to only translate the requested url to lowercase and not things like image sources or links etc? I tried this approach but it also translates the image sources to lowercase so they wont work anymore. How i can translate uppercase to…
Jack M.
  • 1,831
  • 5
  • 24
  • 36
3
votes
0 answers

angular2 IIS url rewrite

I have angular2 app. After publish it on IIS when I refresh browser I'm getting 404 error. As I found here I add web.config file in my dist folder (where I have published my app)
gsiradze
  • 4,583
  • 15
  • 64
  • 111
3
votes
1 answer

Protect file from direct access

I have a folder in which I save files. These files can be accessed from the web page. Let's say that the directory is like manual/fileName.pdf. I also have a page to show a listing of stored files in the manual/ folder and this page is protected…
3
votes
8 answers

hiding page URL in ASP.NET website

I built a simple ASP.NET website which has a menu with all the page URLs linked to each menu item. when I click on a menu item the page URL appears in address bar like "http://mywebsite/xyz/webform1.aspx". I would like to hide this page url and…
RKP
  • 5,285
  • 22
  • 70
  • 111
3
votes
3 answers

How to exclude a controller of being redirect to https in ASP.NET Core 1.1

Following this nice article https://long2know.com/2016/07/asp-net-core-enforcing-https/ i try to enforce HTTPS but with the exception of one single web-api controller that have to response to an embedded system not capable of SSL. The problem exist…
Andre
  • 131
  • 1
  • 5
3
votes
4 answers

URLRewriter for IIS 7 returns 404 Server Error

I've implemented "Approach 3: Using an HttpModule to Perform Extension-Less URL Rewriting with IIS7" from here: - http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx That is based on URLRewriter module: -…
Weng Fai Wong
  • 640
  • 3
  • 16
  • 35
3
votes
7 answers

Postback problem when using URL Rewrite and 404.aspx

I'm using URL rewrite on my site to get URLs like: http://mysite.com/users/john instead of http://mysite.com/index.aspx?user=john To achive this extensionless rewrite with IIS6 and no access to the hosting-server I use the "404-approach". When a…
salle55
  • 2,101
  • 2
  • 25
  • 27
3
votes
3 answers

Creating an admin url for Magento that is admin.magentostore.com (not /admin)

I'm using some load balanced servers and have a requirement wherein all of my admin tasks are relegated to one server. We have determined that the best way to do this is a DNS entry for admin. to point to our primary server. The problem I am seeing…
Matthew
  • 31
  • 1
  • 2
3
votes
1 answer

Secure cookie not being set on AWS ASP.NET MVC website

We had a security review that revealed that the cookies in our ASP.NET MVC application were not being set as secure, despite having the following setting in web.config: The website is not…
Jonno
  • 181
  • 2
  • 12
3
votes
4 answers

How to handle RewriteRules when the word has similar first characters?

I have been trying to figure it out for a hours now, yet, always one of my redirects does not work. I have path something.com/blog/article-name and something.com/blogujeme to act as a article list. But I cannot get those two redirects to work, since…
The Law
  • 344
  • 3
  • 20
3
votes
1 answer

How to rewrite URL in MVC 5 for dynamically populated pages

I'm just creating a database driven web application. For this purpose I created a Controller : public class PagesController : Controller { private StoreDB db = new StoreDB(); public ActionResult LoadOneColumnPageContent(string pageId) …