【问题标题】:Need to restrict url rewrite for a single folder需要限制单个文件夹的 url 重写
【发布时间】:2011-05-09 17:02:43
【问题描述】:

大家好,我设置了以下 htaccess 文件以允许重写 url:

RewriteEngine on

RewriteCond %{HTTP_HOST} ^mysite.com [NC]
#RewriteRule (.*) http://www.mysite.com/$1 [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule .* index.php
RewriteRule !\.(js|ico|gif|jpg|png|swf|css|htm|html|php5)$ index.php 

php_flag magic_quotes_gpc Off
RewriteCond %{REQUEST_FILENAME} -d
AddType text/css .css
AddHandler php5-script .php

我想创建一个 iframe,它指向 public_html 文件夹上的文件夹中的一个文件,但是根据上面设置的 htaccess,我需要为这个文件夹及其内容设置一个例外 - 我该怎么做?

编辑====================

我的文件夹结构设置如下,这是基于 zend 框架的应用程序的标准:

application
html
->importer
library

我希望对 www.mysite.com/importer 的任何引用都将其视为正常引用,而不是将 importer 作为要传递给 index.php 文件的参数。

【问题讨论】:

标签: php zend-framework .htaccess url-rewriting


【解决方案1】:

如果你想限制 url 重写到一个特定的文件夹,只需将 .htaccess 文件与你想应用的规则一起放入这个文件夹。

【讨论】:

    猜你喜欢
    • 2012-09-28
    • 1970-01-01
    • 1970-01-01
    • 2020-02-20
    • 2010-11-07
    • 2021-03-07
    • 2014-10-05
    • 2012-05-23
    • 1970-01-01
    相关资源
    最近更新 更多