的.htaccess仅运行脚本 [英] .htaccess running only script
问题描述
我的网站与Joomla在我的本地Intranet。而且我加code上的.htaccess
I have site with Joomla on my local intranet. and I'm add code on .htaccess
Options -Indexes
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://localhost:8081/.*$ [NC]
RewriteRule ^.* /403-page [L,R]
如果我的测试与地址栏键入地址的DirectLink成功重定向,并且无法打开任何东西的DirectLink和URL直接到:
If I'm test with type address directlink on addressbar successfully redirect, and can't open anything for directlink, and url direct to :
http://localhost:8081/403-page
问题是,如果我想用型 HTTP开放://本地主机:8081 /内联网
对企业内部网的主页,我不能开这一点,将与我测试unscript code然后再次把脚本打开主页,并成功打开主页面,然后我把剧本再次脚本只能使用。一切都确定了我想要的。从网站开通任何链接,无法打开的DirectLink与地址栏键入链接。
the problem is, if I want open with type http://localhost:8081/intranet
for main page of intranet I cant open this, it will test with me unscript code then put again script for open the main page, and success to open main page, then i put again script for script only use. everything is OK with I want. open anything link from website, and cant open directlink with type link on addressbar.
##Options -Indexes
##RewriteEngine On
##RewriteCond %{HTTP_REFERER} !^http://localhost:8081/.*$ [NC]
##RewriteRule ^.* /403-page [L,R]
如何技巧和提示这一点,我只能用在地址栏键入打开炫魅内部网:
how to tricks and tips for this, I can open mainpage intranet only with type on addressbar:
http://localhost:8081/intranet/
和任何类型的DirectLink集着开... ???
and anything type directlink set cant to open...???
推荐答案
添加一个条件,排除了请求 /内联网/
:
Add a condition to exclude requests for /intranet/
:
Options -Indexes
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/intranet/?$
RewriteCond %{HTTP_REFERER} !^http://localhost:8081/.*$ [NC]
RewriteRule ^.* /403-page [L,R]
这篇关于的.htaccess仅运行脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!