Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php .htaccess问题:索引为404_Php_Regex_Apache_.htaccess_Mod Rewrite - Fatal编程技术网

Php .htaccess问题:索引为404

Php .htaccess问题:索引为404,php,regex,apache,.htaccess,mod-rewrite,Php,Regex,Apache,.htaccess,Mod Rewrite,这是我的.htaccess子文件夹中的文件 <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^index\.php$ - [L] RewriteRule (.*) ./index.php?id=$1 [L] </IfModule> 将您的root.htaccess保留为: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On Rewr

这是我的
.htaccess
子文件夹中的文件

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteRule (.*) ./index.php?id=$1 [L]
</IfModule>

将您的root.htaccess保留为:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteRule ^(index\.php|sub-folder(/.*)?)$ - [L,NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>
# END WordPress
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteRule ^(index\.php|sub-folder(/.*)?)$ - [L,NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>
# END WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /sub-folder/

RewriteRule ^index\.php$ - [L,NC]
RewriteRule (.+) index.php?id=$1 [L,QSA]
</IfModule>