【问题标题】:exclude file from htaccess rewrite从 htaccess 重写中排除文件
【发布时间】:2014-06-28 18:19:25
【问题描述】:

我在 Zen Cart 上安装了一个重写插件。我需要一个不被重写的文件。该文件是 ShippingZZencart.php,下面是当前的 htaccess。我以为最后几行不会重写真实文件,但事实如此。

搜索结果如下: RewriteCond %{REQUEST_URI} !^/ShippingZZencart.php [NC]

但它仍然重定向到 index.php

谢谢, 吉姆

###############################################################################
# Common directives
###############################################################################
# NOTE: Replace /shop/ with the relative web path of your catalog in the "Rewrite Base" line below:

Options +FollowSymLinks
RewriteEngine on
RewriteBase /store/

###############################################################################
# Start Ultimate SEO URLs
###############################################################################

# Handles the new URL formats
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-p-([0-9]+)(.*)$ index\.php?main_page=product_info&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pi-([0-9]+)(.*)$ index\.php?main_page=popup_image&pID=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pr-([0-9]+)(.*)$ index\.php?main_page=product_reviews&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pri-([0-9]+)(.*)$ index\.php?main_page=product_reviews_info&products_id=$4&cPath=$2&%{QUERY_STRING} [L]

# Original (unchanged) URL formats
RewriteRule ^(.*)-p-([0-9]+)(.*)$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-m-([0-9]+)(.*)$ index\.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pi-([0-9]+)(.*)$ index\.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pr-([0-9]+)(.*)$ index\.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pri-([0-9]+)(.*)$ index\.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-ezp-([0-9]+)(.*)$ index\.php?main_page=page&id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)(.*)$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]

# All other pages
# Don't rewrite real files or directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index\.php?main_page=$1&%{QUERY_STRING} [L]

【问题讨论】:

    标签: apache .htaccess url-rewriting rewrite


    【解决方案1】:

    RewriteEngine on 正下方添加这一行,使其成为第一条规则:

    RewriteRule ^/?ShippingZZencart.php - [L]
    

    规则说:如果文件是ShippingZZencart.php,不要管它。

    【讨论】:

    • 我试过了,但没有用。 Zen Cart 论坛上的一个建议表明 3rd 方模块未集成为 Zen Cart 页面,但调用 Zen Cart 的 application_top,这是某些 3rd 方模块的已知问题。需要在模块内进行变通。来源:zen-cart.com/…
    猜你喜欢
    • 1970-01-01
    • 2010-12-22
    • 2015-03-21
    • 1970-01-01
    • 1970-01-01
    • 2016-03-21
    • 1970-01-01
    • 1970-01-01
    • 2017-07-31
    相关资源
    最近更新 更多