url-rewriting

Apache Tomcat 9 rewrite valve not working

早过忘川 提交于 2019-12-24 18:28:13
问题 I have been trying to setup my tomcat 9 rewrite valve (on global level) without success, followed every tutorial I have found on the internet, but no matter how i configure my rewirte.config the valve simply does NOT work. So I write the simplest rewrite.config I can think of, which contains only a single line: RewriteRule ^test$ manager/test.jpg So this rule simply means to rewrite http://localhost:8080/test to http://localhost:8080/manager/test.jpg This file is placed inside $CATALINA_HOME

how to Rewrite two parameters URL to SEO friendly URL and Redirect to SEO friendly url

狂风中的少年 提交于 2019-12-24 18:25:04
问题 This is my page url example.com/platform/bidProject.php?pID=JCVGK&name=Proof%20Reading%20Blogs These rules helped me to Rewrite this as example.com/platform/project-bids/JCVGK/Proof-Reading-Blogs/ RewriteRule ^platform/project-bids/(.*)/(.*)/?$ /platform/bidProject.php?pID=$1&name=$2 [L,NC] RewriteCond %{THE_REQUEST} \s/platform/bidProject.php?pID=$1&name=$2 RewriteRule ^platform/bidProject.php?pID=$1&name=$2 /platform/project-bids/(.*)/(.*)/ [NC,R=301,L] but the issue is if I visit to the

RewriteRule for images

佐手、 提交于 2019-12-24 17:46:09
问题 I have to rewrite some url on my site. I've put this in my htaccess to make this change: http://example.com/john/?a=1&b=2 --> http://example.com/index.php?account=john&a=1&b=2 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-zA-Z0-9_-]+)/?$ ./index.php?account=$1 [NC,QSA,L] Now I have to rewrite images url in this way. Every image with this path: example.com/john/images/a.jpg Should point to phisical path: example.com/accounts/john/images/a.jpg How can

Multiple hyphen handling in .htaccess (URL rewriting)

陌路散爱 提交于 2019-12-24 17:46:00
问题 I have a problem with URL rewriting. I have written the following rule in my .htaccess file RewriteRule ^c-([^/]*)-([^/]*)/$ cat.php?id=$1&slug=$2 It gives me URLs like that : http://localhost/actuco/c-628Y8x-france/ (featuring the ID of the category, and its slug). This URL works perfectly. But, when I type this URL : http://localhost/actuco/c-xpS3cc-amerique-du-nord/ it doesn't works anymore. The cause of the problem must be the fact that the latter slug contains several hyphens (amerique

htaccess - how to capture the current rewrited url?

大城市里の小女人 提交于 2019-12-24 17:12:02
问题 I want to capture the current rewrited url via .htaccess in order to create to a custom HTTP Link header. the script url : http://localhost/index.php the rewrited url : http://localhost/news the htaccess: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(news)$ index.php?&m=$1 [NC,L,QSA] RewriteRule ^(.*) - [E=ORIGPROTO:http] RewriteRule ^(.*) - [E=ORIGURI:%{HTTP_HOST}] RewriteRule ^(.*) - [E=ORIGQRY:%{REQUEST_URI}] the output: ORIGPROTO = http ORIGURI =

Coldfusion IIS Rewrite

谁都会走 提交于 2019-12-24 17:11:10
问题 I'm trying to map a URL like this: www.domain.com/some-page.cfm?coid=1 to be more user-friendly like this: www.domain.com/some-page/company-name or www.domain.com/company-name I've tried over and over using URL Rewrite in IIS and can't for the life of me get it to work. Any help would be appreciated! 回答1: I think you may actually want to do the opposite... use IIS to map /abc.htm requests to /?id=abc , right? (For the rule you are requesting, I recommend writing that using ColdFusion.) Here's

URL Rewriting .NET 4 not working?

≯℡__Kan透↙ 提交于 2019-12-24 16:46:05
问题 I have been trying the most basic examples of URL rewriting in .net 4 and can nothing to work locally or on an IIS server? This is my global.asax file <%@ Application Language="C#" %> <script runat="server"> void Application_Start(object sender, EventArgs e) { // Code that runs on application startup RegisterRoutes(System.Web.Routing.RouteTable.Routes); } public static void RegisterRoutes(System.Web.Routing.RouteCollection routeCollection) { routeCollection.MapPageRoute("RouteForCustomer",

Rewrites with Netlify

陌路散爱 提交于 2019-12-24 16:43:28
问题 I am trying to set up some rewrites in Netlify. Here's what I have in my _redirects file: /search xyz=:abc https://example.com/search?xyz=:abc 200 /:abc https://example.com/search?xyz=:abc 200 The first line works as expected, the second line is not working. However, if I change HTTP status code for the second line to 301, it works. Why is that so? I really need to rewrite like the rule in second line. Is there any other modification I can do to make it work? 回答1: I got a response from

Rewrites with Netlify

情到浓时终转凉″ 提交于 2019-12-24 16:43:00
问题 I am trying to set up some rewrites in Netlify. Here's what I have in my _redirects file: /search xyz=:abc https://example.com/search?xyz=:abc 200 /:abc https://example.com/search?xyz=:abc 200 The first line works as expected, the second line is not working. However, if I change HTTP status code for the second line to 301, it works. Why is that so? I really need to rewrite like the rule in second line. Is there any other modification I can do to make it work? 回答1: I got a response from

htaccess to rewrite file in subfolder (2nd level) to folder (1st level)

ⅰ亾dé卋堺 提交于 2019-12-24 16:40:20
问题 Currently, I'm using the below htaccess code to load http://www.domain.com/folder/file.php from http://www.domain.com/file, removing the folder name "/folder/", and the file extension ".php", from the URL. Options +FollowSymLinks RewriteEngine on RewriteCond %{DOCUMENT_ROOT}/folder%{REQUEST_URI}\.php -f [OR] RewriteCond %{DOCUMENT_ROOT}/folder%{REQUEST_URI} -d RewriteRule ^(.*)$ /folder/$1.php [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L] Now, I'm trying to do