简体   繁体   English

ISAPI_Rewrite 3.0…Noob…如何开始? 刚安装

[英]ISAPI_Rewrite 3.0 … Noob … how to get started? just installed

just installed v3 lite to try it out before getting full version. 刚刚安装了v3 lite,然后才能获得完整版本。

i got the follwing in .htaccess file in the root folder of the .net web app 我在.net Web应用程序的根文件夹中找到了.htaccess文件

RewriteEngine On
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP_HOST} ^zzzz-wildcard\.domain\.com
RewriteRule ^(.*)$ http://domain.com/zzzz-wildcard$1 [R]

problem is it doesn't do anything. 问题是它什么也没做。 i got the wildcard set up on iis so that 我在iis上设置了通配符,以便

test.domain.com is served just as domain.com would be. test.domain.com的服务与domain.com一样。 What i want to achieve is to serve any sub-domain user1.domain.com as domain.com/zzzz-wildcard 我要实现的是将任何子域user1.domain.com作为domain.com/zzzz-wildcard

from what i got so far even explicity supplying zzzz-wildcard.domain.com still serves the default.aspx of the domain.com instead of domain.com/zzzz-wildcard/default.aspx 从到目前为止我什至明确提供zzzz-wildcard.domain.com仍然提供domain.com的default.aspx而不是domain.com/zzzz-wildcard/default.aspx

please help. 请帮忙。 i have never worked with isapi rewrite so i have no clue how to go about this.... right now as it stand it doesn't really do anything. 我从未使用过isapi rewrite,所以我不知道如何进行此操作。...就目前而言,它实际上并没有任何作用。 can't say i'm good with regular expressions either :( 也不能说我对正则表达式很好:(

When opening ISAPI_Rewrite Manager and selecting my domain.com from the list of iis websites it says No properties available for this node. 当打开ISAPI_Rewrite Manager并从iis网站列表中选择我的domain.com时,它说No properties available for this node.

** * ** * ** ** * ** * ** EDIT 编辑 ** * ** * ** ** * ** * **

after some more looking around i found out that lite version doesn't support .htaccess so only httpd.conf file that works globally. 经过一番环顾后,我发现lite版本不支持.htaccess,所以只有httpd.conf文件可以全局使用。 So anyway i modified the httpd.conf file instead and it now works.. 所以无论如何我都改为修改了httpd.conf文件,现在它可以工作了

however it just redirects zzzz-wildcard.domain.com to domain.com/zzzz-wildcard 但是它只是将zzzz-wildcard.domain.com重定向到domain.com/zzzz-wildcard

Is there a way to keep the url intact and not redirect? 有没有办法保持url完整并且不重定向? but still serve the pages from domain.com/zzzz-wildcard ? 但仍然投放来自domain.com/zzzz-wildcard的页面?

finally solved after looking around other answers on stackoverflow 在Stackoverflow上寻找其他答案后终于解决了

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(.*?)\.domain\.com$ [NC]
RewriteRule (.*) /zzzz-wildcard/%{REQUEST_URI} [NC]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM