.htaccess索引文件上的错误404

时间:2016-08-15 12:37:48

标签: html .htaccess web

美好的一天,

我想知道你是否可以帮助我 我有一个.htaccess文件:

RewriteEngine On
RewriteCond %{REQUEST_METHOD} =POST
RewriteRule ^ - [L]

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

## hide .php extension snippet

# To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L]

ErrorDocument 404 http://scytech.co.za/Page-Not-Found/404

当我尝试打开http://admin.scytech.co.za时,它会给我一个错误404,但当我尝试打开http://admin.scytech.co.za/index时,它会100%正常工作。你能帮助我吗?

1 个答案:

答案 0 :(得分:1)

试试这个......

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]