url-rewriting

Apache URL Re-writing not functioning properly

南笙酒味 提交于 2020-01-11 08:20:29
问题 I am trying to use apache-rewrite rule to convert the below URL: http://localhost/foo/bar/news.php?id=24 Into this format: http://localhost/foo/bar/news/foo-bar The number 24 is an id of a random row from a MySQL table, which also contains title and content fields. MariaDB [blog]> select * from articles; +----+---------+----------+ | id | title | content | +----+---------+----------+ | 1 | foo-bar | bla bla | +----+---------+----------+ 1 row in set (0.00 sec) I have the following rule inside

Url rewriting Angular 4 on tomcat 8 server

不问归期 提交于 2020-01-10 20:12:07
问题 I have deployed an angular 4 application (with angular routing) on tomcat server with "frontend-maven-plugin" (V1.6) but url comportement is very strange. In fact, when i click on refresh button on all pages, there is a HTTP 404 error . When i try to acess on root page, there is no redirection to index.html . Theses error are only present with tomcat deployment (it work fine with nodejs). How can i configure tomcat in order to correct this problems ? Thanks for your responses. 回答1: I think

Url rewriting Angular 4 on tomcat 8 server

柔情痞子 提交于 2020-01-10 20:12:03
问题 I have deployed an angular 4 application (with angular routing) on tomcat server with "frontend-maven-plugin" (V1.6) but url comportement is very strange. In fact, when i click on refresh button on all pages, there is a HTTP 404 error . When i try to acess on root page, there is no redirection to index.html . Theses error are only present with tomcat deployment (it work fine with nodejs). How can i configure tomcat in order to correct this problems ? Thanks for your responses. 回答1: I think

Remove .html from URLs with a redirect

走远了吗. 提交于 2020-01-10 09:04:13
问题 We have a website, unfortunately all the URLs have the .html suffix, its a Magento installation, Magento allows you to change this on the CMS, but again, unfortunately all this URLs with .html suffix have a good ranking in Google. We need to redirect to non .html . So, consider the following scenario, we are rebuilding this site from scratch, so we have the same urls on the new site but without the .html suffix. Now is: www.example.de/cool-shoes.html Will be: www.example.de/cool-shoes So www

.htaccess - how to remove repeated characters from url?

左心房为你撑大大i 提交于 2020-01-10 05:36:26
问题 I have the following url: example.com/hellllllllllo And I was looking for a way to avoid repeated characters up to double. Inspired by this question/answers Remove Characters from URL with htaccess I have created the following htaccess document to avoid repeated characters. If the character is repeated more than 23 times the url is not completely rewrited and I was wondering if there is any possible improvment? RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_URI} ^(.*)l{3,}(.*)$

Hide GET parameter from URL

橙三吉。 提交于 2020-01-10 05:13:11
问题 How to hide URL GET parameters (http://domain.com/MyFirstYii/page?view=about). I've searched lot of posts. They all are saying about rewrite and URL manager, but i couldn't achieve what i want. :( My scenario is, I just want to hide the URL GET parameters. Eg: http://domain.com/MyFirstYii/page***?view=about*** I wanted to hide ***?view=about*** . Then URL should look like this http://domain.com/MyFirstYii/page . Other pages like this http://domain.com/MyFirstYii/post . In a simple words my

Url rewriting mod_rewrite

给你一囗甜甜゛ 提交于 2020-01-09 11:53:04
问题 I have the url such as: page.com/content.php?xname=p&yname=q&zid=1 I want to rewrite this url using apache mod_rewrite into something like: page.com/p/q/ note there should not be 'zid' parameter in renamed url. I know expressions are passed as GET into the original url. Is it possible to rename as above. If yes, How to achieve this? 回答1: This one works fine for me and will rewrite request for /p/q/ to /content.php?xname=p&yname=q&zid=1 . Options +FollowSymLinks -MultiViews RewriteEngine On

Url rewriting mod_rewrite

旧城冷巷雨未停 提交于 2020-01-09 11:51:48
问题 I have the url such as: page.com/content.php?xname=p&yname=q&zid=1 I want to rewrite this url using apache mod_rewrite into something like: page.com/p/q/ note there should not be 'zid' parameter in renamed url. I know expressions are passed as GET into the original url. Is it possible to rename as above. If yes, How to achieve this? 回答1: This one works fine for me and will rewrite request for /p/q/ to /content.php?xname=p&yname=q&zid=1 . Options +FollowSymLinks -MultiViews RewriteEngine On

How to remove parameters in URL and display it in address bar without causing redirect in Javascript?

不想你离开。 提交于 2020-01-09 11:07:08
问题 I have found numerous answers on how to extract the URL without the parameters. How do you rewrite the URL in the address bar without causing the page to reload with the new URL? shortURL = top.location.href.substring(0, top.location.href.indexOf('?')); top.location.href = shortURL // Causes redirect The goal is to extract the parameters in Javascript but not display them in the address bar. 回答1: In modern browsers with support for the History object, you can use either history.replaceState()

Missing CSS file and images after URL rewrite

家住魔仙堡 提交于 2020-01-09 06:55:33
问题 I'm trying to make user friendly URL using mode rewrite. My problem is, that after giving category like 'name' to my URL, when I call the page using new URL, it can't load the CSS file or images. I have a link like: localhost/mywebsite/project?id=22 New link is something like localhost/mywebsite/project/22/myproject.project htaccess code: RewriteRule ^project/([0-9]*)/.*\.project$ /project.php?project=$1 [L] (it might not be 100% right but I don't have access to my code right now so I just