url-rewriting

ASP.net url rewrite force lowercase

人盡茶涼 提交于 2019-12-11 00:33:24
问题 I have: <!-- Force lowercase URLS --> <rewrite url="~/(.*[A-Z]+.*)$" to="~/handlers/permredirect.ashx?URL=${lower($1)}" /> Perm redirect simply 301 redirects to the new URL. This rule is meant to redirect any URL with an uppercase char to the lower case one. This however creates a redirect loop, any ideas why? The only rules running so far are: <rewriter> <!-- Remove Trailing Slash for all URLS--> <rewrite url="~/(.*)/($|\?(.*))" to="~/handlers/permredirect.ashx?URL=${lower($1)}$2" /> <!--

URL Rewrite Including Trailing Slash If Not Present

我的梦境 提交于 2019-12-11 00:26:48
问题 I've got this RewriteRule to work. RewriteBase /my/path/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /my/path/index.php [L] So URLs with a trailing slash work. http://localhost/my/path/foo/bar/ The problem is that URLs without the trailing slash will break relative links. Plus it dosen't look good. This reaches the maximum number of internal redirects. RewriteRule ^/my/path/(.*[^/])$ $1/ [R] RewriteRule . /my/path/index.php [L] And this will do...

Converting Mod-rewrite rules which use %(QUERY_STRING) to NGINX rewrite format?

感情迁移 提交于 2019-12-11 00:22:20
问题 I've been stuck the last few days trying to convert the following Apache/Mod_Rewrite rewrite rule to NGINX format. Anyone know where I am going wrong? MOD_REWRITE: RewriteCond %{QUERY_STRING} topic=([0-9]+) RewriteRule /forum/index\.php /forum/vbseo301.php?action=thread&oldid=%1 [L] NGINX: location /forum/index.php { if ($args ~ "topic=([0-9]+)"){ rewrite ^/forum/index\.php?topic=(.+)$ /forum/vbseo301.php?action=thread&oldid=$1 last; } } 回答1: This does not answer the question -- please read

how to remove .py from the url in jython

谁说胖子不能爱 提交于 2019-12-11 00:05:50
问题 I am trying to remove .py extension from the url, I am using this tutorial: http://www.jython.org/jythonbook/en/1.0/SimpleWebApps.html my web.xml is as follows: <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" > <servlet> <servlet-name>PyServlet</servlet-name> <servlet-class>org.python

IIRF URL rewrite to force www prefix: example.com -> www.example.com

好久不见. 提交于 2019-12-10 23:57:53
问题 I'm trying to do something pretty simple in iirf. I want all requests that are missing the www. prefix to have it added. This is my IsapiRewrite4.ini: RewriteCond %{HTTP_HOST} ^example\.com$ [I] RewriteRule ^(.*)$ www.example.com/$1 [R=301,L] This is my SampleUrls.txt: example.com example.com/grants www.example.com www.example.com/grants I place the files in the same directory as TestDriver.exe, and run testdriver -d . All the tests are ignored: NO ACTION 'example.com' ==> -- NO ACTION

Rewrite rule & escaping (encoded) forward slashes within URL

夙愿已清 提交于 2019-12-10 23:57:17
问题 I have developed this RewriteRule which has been working great, up until I discovered an issue. This is the rule here: RewriteCond %{REQUEST_URI} ^/([^/]+)/([^/]+)/([^/]+)/(.*)$ RewriteCond %{DOCUMENT_ROOT}/%1/%2/%4.php -f RewriteRule ^ /%1/%2/%4.php?id=%3 [QSA,L] The URL format is like so: /home/service/ ID /scriptname note that ID is dynamic and the RewriteRule does not take not of it when checking for the files existence. But in this one scenario I found out, one of the IDs I'm using

Rewrite URLs on an HTTPS page to HTTP

天涯浪子 提交于 2019-12-10 23:28:57
问题 Using the 'bindings' feature of IIS7, I added an SSL certificate at the root of my website to 'https' (port 443). Then, I required an SSL connection for a specific directory, '/secure-directory/'. I can now redirect to this directory by explicitly linking to the https address: https://www.mysite.com/secure-directory/. The problem is that /secure-directory/ is the only directory I want to use SSL, and it contains navigation links which are now maintaining the https prefix, so my 'Home' link

nginx proxy_pass omitting path

徘徊边缘 提交于 2019-12-10 22:41:30
问题 I have configured a nginx reverse proxy: location / { root /var/www/html; index index.html; } location /login { proxy_pass http://127.0.0.1:9080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } location /app { rewrite ^/app/(.*)$ /$1 break; proxy_pass https://10.11.12.13/1020/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } The server listening on port 9080 redirects to the route /app/{generated subpath}. The server on IP 10.11.12.13 processes

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

江枫思渺然 提交于 2019-12-10 20:57:14
问题 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 paths. The problem comes in when navigating within the app using relative paths. any kind of relative path. All relative paths redirect to the corresponding http://domain/version/page.aspx instead of to the http://domain/COMPANY/page.aspx that it

Redirect based on Accept-Language

瘦欲@ 提交于 2019-12-10 19:49:25
问题 I need to honor the web browser's list of language preferences. Supported languages are English and French. For example: http_accept_language="jp-JP;fr;en-US;en" redirects to a directory called /French/. How can I do this with rewrite rules in my .htaccess file? 回答1: I wouldn’t use mod_rewrite for this but a more powerful language. Because Accept-Language is a list of weighted values (see quality value) and the occurrence of one of the identifiers does not mean that it’s preferred over