.htaccess URL 重写不起作用

发布于 2024-10-19 14:29:38 字数 1693 浏览 1 评论 0原文

为什么此脚本不适用于 /ProjectProfiles?

# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.79

RewriteEngine on
RewriteCond $1 !(cp|img|files|js|css|index\.php|x|flat|robots\.txt|file\.html|uploadfile\.php)
RewriteRule ^(.*)$ /index.php/$1 [L]

日志:

147240/initial] (2) init rewrite engine with requested uri /x/email2image.php?prefix=sales
(1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
(3) applying pattern '^(.*)$' to uri '/x/email2image.php'
(4) RewriteCond: input='/x/email2image.php' pattern='(favicon.ico|cp|img|files|js|css|index\.php|x|flat|robots\.txt|file\.html|uploadfile\.php)' => not-matched

---------- WHY DOESNT THIS WORK?? --------------------------
(2) init rewrite engine with requested uri /ProjectProfiles
(1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
(3) applying pattern '^(.*)$' to uri '/ProjectProfiles'
(4) RewriteCond: input='/ProjectProfiles' pattern='(favicon.ico|cp|img|files|js|css|index\.php|x|flat|robots\.txt|file\.html|uploadfile\.php)' => not-matched
------------------------------------------------------------

(2) init rewrite engine with requested uri /ContactUs
(1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
(3) applying pattern '^(.*)$' to uri '/ContactUs'
(4) RewriteCond: input='/ContactUs' pattern='(favicon.ico|cp|img|files|js|css|index\.php|x|flat|robots\.txt|file\.html|uploadfile\.php)' => matched
(1) Rewrite URL to >> /index.php//ContactUs
(2) rewrite '/ContactUs' -> '/index.php//ContactUs'
(2) internal redirect with /index.php//ContactUs [INTERNAL REDIRECT]

Why doesnt this script work for /ProjectProfiles?

# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.79

RewriteEngine on
RewriteCond $1 !(cp|img|files|js|css|index\.php|x|flat|robots\.txt|file\.html|uploadfile\.php)
RewriteRule ^(.*)$ /index.php/$1 [L]

Log:

147240/initial] (2) init rewrite engine with requested uri /x/email2image.php?prefix=sales
(1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
(3) applying pattern '^(.*)
 to uri '/x/email2image.php'
(4) RewriteCond: input='/x/email2image.php' pattern='(favicon.ico|cp|img|files|js|css|index\.php|x|flat|robots\.txt|file\.html|uploadfile\.php)' => not-matched

---------- WHY DOESNT THIS WORK?? --------------------------
(2) init rewrite engine with requested uri /ProjectProfiles
(1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
(3) applying pattern '^(.*)
 to uri '/ProjectProfiles'
(4) RewriteCond: input='/ProjectProfiles' pattern='(favicon.ico|cp|img|files|js|css|index\.php|x|flat|robots\.txt|file\.html|uploadfile\.php)' => not-matched
------------------------------------------------------------

(2) init rewrite engine with requested uri /ContactUs
(1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
(3) applying pattern '^(.*)
 to uri '/ContactUs'
(4) RewriteCond: input='/ContactUs' pattern='(favicon.ico|cp|img|files|js|css|index\.php|x|flat|robots\.txt|file\.html|uploadfile\.php)' => matched
(1) Rewrite URL to >> /index.php//ContactUs
(2) rewrite '/ContactUs' -> '/index.php//ContactUs'
(2) internal redirect with /index.php//ContactUs [INTERNAL REDIRECT]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

止于盛夏 2024-10-26 14:29:38

因为 ProjectProfiles 包含“文件”。根据您希望其他匹配如何进行,请尝试例如

RewriteCond $1 !^/(cp|img|files|js|css|index\.php|x|flat|robots\.txt|file\.html|uploadfile\.php)$

Because ProjectProfiles contains "files". Depending on how you intend your other matches to work, try e.g.

RewriteCond $1 !^/(cp|img|files|js|css|index\.php|x|flat|robots\.txt|file\.html|uploadfile\.php)$
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文