" 300多种选择"由于htaccess文件导致的错误

时间:2018-03-13 18:27:21

标签: .htaccess php-extension

我最近遇到的网站问题似乎与我的.htaccess文件有关。 主要问题是某些页面正在重定向到自己,而其他页面则显示300多重选择错误页面,该页面中只有1页。

我的.htaccess文件的原始设置既可以连接我的自定义错误页面,也可以删除每页末尾显示的扩展名(.eg /about.php将显示为/about)。

以下是当前.htaccess文件的内容,以及指向我网站的链接。

Options -Indexes
#RewriteEngine On
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteBase /
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L] 
# Added automatically by Gridhost panel Tuesday 29th of April 2014 07:12:58 PM
ErrorDocument 404 /404.php
ErrorDocument 401 /401.php
ErrorDocument 403 /403.php
ErrorDocument 405 /405.php
ErrorDocument 500 /500.php
DirectoryIndex welcome.html index.html index.htm index.php

www.andrewcourtney.co.uk

我已经联系过我的网站主持人,但他们无法提供帮助,并建议我在论坛上发帖以找出问题所在。

我还将htaccess文件修改为以下内容但无效(在隐身模式下检查):

Options -Indexes

RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [QSA,L]

ErrorDocument 404 /404.php
ErrorDocument 401 /401.php
ErrorDocument 403 /403.php
ErrorDocument 405 /405.php
ErrorDocument 500 /500.php

DirectoryIndex welcome.html index.html index.htm index.php

请有人建议吗?

干杯,

安德鲁

编辑:

我现在更新了我的htaccess以包含MultiViews和CheckSpelling Off的行,但现在所有页面都重定向回主页?

Options -Indexes
Options -MultiViews
CheckSpelling off

#RewriteEngine On
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^([^\.]+)$ $1.php [NC,L]

RewriteBase /

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L] 

# Added automatically by Gridhost panel Tuesday 29th of April 2014 07:12:58 PM
ErrorDocument 404 /404.php
ErrorDocument 401 /401.php
ErrorDocument 403 /403.php
ErrorDocument 405 /405.php
ErrorDocument 500 /500.php

DirectoryIndex welcome.html index.html index.htm index.php

0 个答案:

没有答案
相关问题