写.htaccess文件,而不%{} REQUEST

编程入门 行业动态 更新时间:2024-10-13 02:21:26
本文介绍了写.htaccess文件,而不%{} REQUEST_FILENAME的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

所以我有一个荒谬的问题,托管公司似乎无法照顾本身。我有一个Windows服务器具有ISAPI重写3运行,让我使用.htaccess文件进行文字preSS在网站上。但我注意到,

So I have a ridiculous problem that the hosting company cannot seem to take care of by itself. I have a website on a windows server that has ISAPI Rewrite 3 running to allow me to use .htaccess files for wordpress. But I noticed that the

RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d

语句不工作。他们将被忽略。这是一个配置的问题?在此同时我也有网站注册,并与我从什么地方

statements are not working. They are just ignored. Is this a configuration issue? In the mean time I have the site up and running with this clever line that I stole from somewhere

RewriteCond %{REQUEST_URI} (/[^.]*|\.(html?|php))$ [NC]

的问题是,使用这种线I不能访问所存在的实际目录。例/可湿性粉剂管理员/所以如果我要进行更改,在管理方面我必须使该行的限制由IP进行更改,然后关闭该行。完全荒谬的。

The problem is that using this line I cannot access an actual directory that exists. Ex. /wp-admin/ so if I want to make changes in the admin area I have to enable that line that restricts by IP make the changes and then turn off that line. Utterly ridiculous.

RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} (/[^.]*|\.(html?|php))$ [NC] #disallow or allow just my IP address #RewriteCond %{REMOTE_HOST} !1.2.3.4 RewriteRule .* /index.php [L]

任何解决方案,因此,我仍然可以访问存在的目录,而使用%{} REQUEST_FILENAME?

Any solutions so that I can still access directories that exist without using the %{REQUEST_FILENAME}?

推荐答案

嗯..我有赫利的ISAPI_Rewrite V3实际上在IIS 6上运行(与7 2年前收到了关于IIS)..和这些指令的工作细

Well .. I have Helicon ISAPI_Rewrite v3 running on IIS 6 (and had it on IIS 7 2 years ago) .. and these instructions actually work fine:

RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d

这可能不是那样好,如果URL的一部分是虚拟的文件夹/应用..但它正常工作与真正的文件和文件夹。尝试这些替代(应该完全一样,如果没有虚拟的东西参与):

It may not work that well if part of the URL is virtual folder / application .. but it works fine with real files and folders. Try these instead (should work exactly the same if no virtual stuff involved):

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d

更多推荐

写.htaccess文件,而不%{} REQUEST

本文发布于:2023-10-31 13:33:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546234.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:而不   文件   htaccess   REQUEST

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!