【问题标题】:.htaccess Error 404 on index file.htaccess 索引文件上的错误 404
【发布时间】:2016-08-15 20:50:03
【问题描述】:

早安,

我想知道你是否可以帮助我。
我有一个 .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% 工作
您能帮帮我吗?

【问题讨论】:

    标签: html .htaccess web


    【解决方案1】:

    试试这个...

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

    【讨论】:

    • 尝试在 RewriteRule 下放入 ^([^\.]+)$ $1.php [NC,L]
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-05-24
    • 1970-01-01
    • 2018-11-09
    • 2011-06-30
    • 1970-01-01
    • 2015-08-22
    • 2014-05-08
    相关资源
    最近更新 更多