url-rewriting

How to create a EXCEPT Rewrite Rule at IIS

大兔子大兔子 提交于 2020-01-17 03:01:21
问题 I have a IIS Site with Rewrite Rule to redirect all requests to https. I have a internal webservice which works with http but rewrite rule modify "http" request to a "https". When happens, webservice returns an error "Object Moved". I tried use "AllowAutoRedirect" with true value but it doesn't work. How to create a EXCEPT Rewrite Rule to access this webservice ou how to make webservice work with https protocol? Thanks! Best Regards, Andre Mesquita 回答1: One way is to add the rule before the

URL Re-Writing in ASP.Net

旧街凉风 提交于 2020-01-16 16:30:23
问题 I want to implemewnt URL-Rewriting in way that user can access website with username.domain.com e.g. www.abc.com/login.aspx I should be able to access this like www.username.abc.com/login.aspx blogspot is also one of the example like http://username.blogspot.com/ Plz suggest me how can I accomplish this. Thanks 回答1: Basically what you need to do is use a tool like the Managed Fusion URL Rewriter and Reverse Proxy, with the following rule. RewriteCond {HOST} www\.(.*)\.abc\.com RewriteRule ^

.htaccess redirect query string value to another key

人走茶凉 提交于 2020-01-16 14:17:10
问题 What i'm trying to do is rewrite the following pattern http://example.org/path?articleid=5657 to this pattern: http://example.org/path?p=5657 Essentially it comes down to changing the key to the url parameter, i have searched extensively with no clear example of how to do this exact thing using only htaccess rewrite rules. i've tried this general approach with no luck RewriteCond %{QUERY_STRING} ^articleid=([0-9]*)$ RewriteRule ^articleid=([0-9]*)$ /?p=$1 [R=301,L] 回答1: You can't match

Regex URL match on anything but www

时光毁灭记忆、已成空白 提交于 2020-01-16 13:17:30
问题 I'm using IIS7 and the URL Rewrite module. I would like to use regex to match any subdomain apart from www. So... frog.domain.co.uk = Match m.domain.co.uk = Match anything.domain.co.uk = Match www.domain.co.uk = No match This way I can redirect any subdomain that someone types in back to www. 回答1: you can use 301 in .htaccess for this. 回答2: This will match what you want: ^(?!=www\.).* Which is a negative lookahead for www. . Not sure if you need the trailing .* 回答3: Use this rule -- it will

.htaccess / redirecting to https://www.example.com and virtual folder access

穿精又带淫゛_ 提交于 2020-01-16 05:28:07
问题 I have a domain example.com . I want users to be redirected to https://www.example.com whenever one of the following is typed: http://example.com http://www.example.com https://example.com I also need to redirect people accessing /asdf (or /asdf/ ) to /index.php?folder=asdf . I found some examples of code doing the first part, but there was always a debate about their effectiveness. Edit: (need some more help! :)) 回答1: Try these mod_rewrite rules: RewriteEngine on RewriteCond %{HTTP_HOST} !

IIS 7.0 URL Rewrite Module - Root URL doesn't display

﹥>﹥吖頭↗ 提交于 2020-01-16 05:04:07
问题 I'm trying to setup a PHP website in IIS 7.0 with URL rewriting enabled using this module (http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1691) I've got the whole thing running fine for inner pages of the site, but my root URL "/" doesn't work any more. I want the structure of my URLs to be www.test.com/test-page.html and this is rewritten to www.test.com/index.php?page=test-page The rule that I have specified is as follows: Regular expression to match : ^([^/.]+)/?.html Rewrite to:

301 redirect to full path

百般思念 提交于 2020-01-16 00:35:29
问题 I have a lot incorrect back links, the links are pointing to: http://www.domain.com/tags/keyword while the correct path is http://www.domain.com/tags/keyword/ there are hundreds of those...how could i 301 redirect from the wrong links to the correct links? Thank you so much in advance 回答1: You can try this code: RewriteBase / RewriteRule ^tags/([^/]+)$ /tags/$1/ [L,R=301] RewriteBase / tells apache that your URI starts by a / . If your site was in a subfolder you should write RewriteBase

htaccess rewrite slug in a url

天涯浪子 提交于 2020-01-15 12:33:46
问题 I've searched and searched for help on a rewrite rule but nothing seems to match specifically what I'm trying to do, hopefully someone can help? I'm trying to replace a slug in a url that could have various other possible slugs before and after it. e.g. http://www.example.com/slug/old_slug to http://www.example.com/slug/new_slug or /slug/old_slug/slug to /slug/new_slug/slug or /slug/old_slug/slug/slug to /slug/new_slug/slug/slug or finally: /slug/old_slug/slug?param=1&param=2 to /slug/new

htaccess rewrite slug in a url

淺唱寂寞╮ 提交于 2020-01-15 12:33:19
问题 I've searched and searched for help on a rewrite rule but nothing seems to match specifically what I'm trying to do, hopefully someone can help? I'm trying to replace a slug in a url that could have various other possible slugs before and after it. e.g. http://www.example.com/slug/old_slug to http://www.example.com/slug/new_slug or /slug/old_slug/slug to /slug/new_slug/slug or /slug/old_slug/slug/slug to /slug/new_slug/slug/slug or finally: /slug/old_slug/slug?param=1&param=2 to /slug/new

How to add subdomain in .htaccess and force WWW in url

Deadly 提交于 2020-01-15 11:51:14
问题 I have the following code to force WWW in url rewriteCond %{HTTP_HOST} !^www.example.com [NC] rewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] I want to add a subdomain max.example and refer to www.example.com/update/max directory If I do not add any rule, max.example.com will redirect to www.example.com/update/max . If I remove force WWW in url it works. But I still need force WWW in url. How to write the rule? Thanks! 回答1: Change your rule to this: RewriteCond %{HTTP_HOST} !^(www|max)