2012-03-03 17 views
0

在我的.htaccess文件我有以下的.htaccess錯誤與捕捉得到的變量和斜線

# Use PHP5 Single php.ini as default 
    AddHandler application/x-httpd-php5s .php 

    Options -Indexes 


    # preserve bandwidth for PHP enabled servers 
    <ifmodule mod_php4.c> 
    php_value zlib.output_compression 16386 
    </ifmodule> 

    # For security reasons, Option followsymlinks cannot be overridden. 
    #Options +FollowSymLinks 
    Options +SymLinksIfOwnerMatch 
    RewriteEngine On 
    RewriteRule ^faq/?$ faq.php 
    RewriteRule ^about/?$ about.php 
    RewriteRule ^portfolio/(.*)$ portfolio.php?p=$1 

      #Error Page___NOT found 
    ErrorDocument 404 /notfound.php 

我的投資組合中只包含了部分「名人」,「婚禮」和「工業」 即只有以下網頁是有效的組合:

在某些情況下,「組合」頁面
mysite.com/portfolio/celebrity 
    mysite.com/portfolio/weddings 
    mysite.com/portfolio/industrial 

我有問題:當我訪問

"mysite.com/portfolio/celebrity" 
    "mysite.com/portfolio/weddings" 
    "mysite.com/portfolio/industrial" 

一切正常fine.If,但是,我訪問

"mysite.com/portfolio/celebrity/" 
    "mysite.com/portfolio/weddings/" 
    "mysite.com/portfolio/industrial/" 

(注意尾隨斜線),火狐給了我下面的錯誤

Firefox has detected that the server is redirecting the request for this address in a way that will never complete. 

我試着

替換最後一行
RewriteRule ^portfolio/(.*)/?$ portfolio.php?p=$1 

這也沒有幫助,並顯示上述錯誤。

參觀

"mysite.com/portfolio/some-non-existent-portfolio" 

OR

"mysite.com/portfolio/some-non-existent-portfolio/" 

不重定向到 「notfound.php」

+0

嘗試添加'選項-MultiViews' – Gerben 2012-03-03 18:21:02

+0

不,不解決這個問題...任何其他的想法? – goingpete 2012-03-03 20:49:08

回答