Joomla htaccess重写自定义index.php问题的异常
我试图对 Joomla 1.6.3 中的默认 htaccess 进行例外处理,以便为我自己的 php 脚本提供一个友好的 url。
这个想法是以下已经工作的网址: www.mysite.com/wrx/system/index.html?parameter1=AE23HtySght34P 可以像这样外部调用,但也显示为: www.mysite.com/wrx/system/AE23HtySght34P/
我在 htaccess 中放置的规则正在工作,但将其恢复为显示带有参数的 php...
任何帮助将不胜感激。
西蒙
.htaccess:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule .* index.php [F]
RewriteRule ^wrx/system/([A-Za-z0-9-]+)$ /wrx/system/index.php?id_parameter1=$1 [R=301,L]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]
I am trying to make an exception to the default htaccess from Joomla 1.6.3 for having a friendly url for my own php scripts.
The idea is that the following already working url:
www.mysite.com/wrx/system/index.html?parameter1=AE23HtySght34P
can externally be called like this, but also shows as:
www.mysite.com/wrx/system/AE23HtySght34P/
The rule i placed in the htaccess is working, but reverts it to showing the php with the parameter...
Any help would be appreciated.
Simon
.htaccess:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule .* index.php [F]
RewriteRule ^wrx/system/([A-Za-z0-9-]+)$ /wrx/system/index.php?id_parameter1=$1 [R=301,L]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将此放在
RewriteEngine on
之后,因此它是第一个被评估的。Put this one just after
RewriteEngine on
, so it's the first being evaluated.