Asp.net mvc 如何?在每个文件夹的不同.htaccess文件中重写mod_,然后移动到vhost.conf-mvc中
我希望我能在这里找到帮助。 我有一个非常复杂的MVC驱动的应用程序 下面是它的工作原理: 这些是我的目录Asp.net mvc 如何?在每个文件夹的不同.htaccess文件中重写mod_,然后移动到vhost.conf-mvc中,asp.net-mvc,apache,mod-rewrite,Asp.net Mvc,Apache,Mod Rewrite,我希望我能在这里找到帮助。 我有一个非常复杂的MVC驱动的应用程序 下面是它的工作原理: 这些是我的目录 /-(/dispatcher.php作为mvc1应用程序引导) /mvc2-(/mvc2/dispatcher.php作为mvc2应用程序引导) /mvc3-(/mvc3/dispatcher.php作为mvc3应用程序引导) 所有3个都可以在一个域example.com下访问 example.com/-是第一个MVC应用程序 example.com/mvc2-是第二个应用程序 exampl
RewriteEngine on
RewriteRule !\.(js|ico|gif|jpg|png|css|htc|swf|html|xml)$ dispatcher.php
代码是正确的我的问题是,我想将其移动到vhost.conf文件或httpd.conf中,该文件在Apache启动时加载到内存中,并删除所有.httaccess以提高Apache性能
当前的解决方案工作正常,因为each.htaccess正在覆盖其父目录one,我不必在vhost.conf中工作
到目前为止,我已经尝试将其转化为指令,但没有成功。有什么想法吗
非常感谢你的帮助
干杯试试这个规则:
RewriteEngine on
RewriteCond %{REQUEST_URI} !.*\.(js|ico|gif|jpg|png|css|htc|swf|html|xml)$
RewriteRule ^(/mvc2|/mvc3)?/ $1/dispatcher.php
这应该将/mvc2/..
或/mvc3/..
的请求重定向到相应的dispatcher.php。仅当URL路径不以/mvc2/..
或/mvc3/..
开头时,才会重定向到根目录中的dispatcher.php