Apache2,PHP7.1,mod_rewrite,.htaccess 404

Apache2,PHP7.1,mod_rewrite,.htaccess 404,php,apache,.htaccess,mod-rewrite,error-handling,Php,Apache,.htaccess,Mod Rewrite,Error Handling,嗨,我似乎在修改mod_时遇到了一些问题 .htaccess正在从/welcome to/welcome.php重写URL 但他们返回了404个错误 Apache2 PHP7.1 MySQL 5.8 mod_rewrite已启用并加载 有人能帮我一下吗?我完全迷路了 <IfModule mod_rewrite.c> RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %

嗨,我似乎在修改mod_时遇到了一些问题

.htaccess正在从/welcome to/welcome.php重写URL

但他们返回了404个错误

Apache2 PHP7.1 MySQL 5.8 mod_rewrite已启用并加载

有人能帮我一下吗?我完全迷路了

    <IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

#For removing extension as Options +MultiViews not working with RewriteRule
RewriteRule ^([a-zA-Z0-9_]+)$ $1.php [QSA,NC,L]

RewriteRule ^profile/([a-zA-Z0-9._@\-]+)$ profile.php?u=$1 [QSA,NC,L]
RewriteRule ^profile/ profile.php [QSA,NC,L]

RewriteRule ^groups/([0-9]+)$ groups.php?grp=$1 [QSA,NC,L]
RewriteRule ^groups/ groups.php [QSA,NC,L]

RewriteRule ^view_post/([a-zA-Z0-9]+)$ view_post.php?post=$1 [QSA,NC,L]

ErrorDocument 404 /404.php

#DirectoryIndex Options +Indexes

<FilesMatch ".(htaccess)">
  order allow,deny
  deny from all
</FilesMatch>

#Options +MultiViews

IndexIgnore *
</IfModule>

重新启动发动机
重写基/
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
#用于删除扩展为选项+不使用重写规则的多视图
重写规则^([a-zA-Z0-9_quo;)+$$1.php[QSA,NC,L]
重写规则^profile/([a-zA-Z0-9.@\-]+)$profile.php?u=$1[QSA,NC,L]
重写规则^profile/profile.php[QSA,NC,L]
重写规则^groups/([0-9]+)$groups.php?grp=$1[QSA,NC,L]
重写规则^groups/groups.php[QSA,NC,L]
重写规则^view_post/([a-zA-Z0-9]+)$view_post.php?post=$1[QSA,NC,L]
ErrorDocument 404/404.php
#目录索引选项+索引
命令允许,拒绝
全盘否定
#选项+多视图
IndexIgnore*

这是我的.htaccess文件。

试着删除
RewriteBase/
事实上,这更破坏了它。我修复了它。只需在apache2中的000-default.conf中更改回localhost。尝试删除
RewriteBase/
,事实上这更破坏了它。我修复了它。只需在apache2的000-default.conf中更改回localhost。