Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/81.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
htaccess是否将php重写为html,无post方法?_Php_Html_Forms_.htaccess_Http Post - Fatal编程技术网

htaccess是否将php重写为html,无post方法?

htaccess是否将php重写为html,无post方法?,php,html,forms,.htaccess,http-post,Php,Html,Forms,.htaccess,Http Post,我使用这个htaccess将php扩展重写为.html。 我有一个有效的表单,它应该发布到一个url,但我无法获取发布数据,我认为这与htaccess有关 Options +FollowSymlinks Options -Indexes RewriteEngine On RewriteBase /mypath/ # Rewrite to SEF URL's RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}

我使用这个htaccess将php扩展重写为.html。 我有一个有效的表单,它应该发布到一个url,但我无法获取发布数据,我认为这与htaccess有关

Options +FollowSymlinks
Options -Indexes
RewriteEngine On

RewriteBase /mypath/

# Rewrite to SEF URL's
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/(.*)/(.*)/(.*)\.html index.php?a=$1&b=$2&c=$3&d=$4 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/(.*)/(.*)\.html index.php?a=$1&b=$2&c=$3 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/(.*)\.html index.php?a=$1&b=$2 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\.html index.php?a=$1 [QSA,L]

有人能解决我的问题吗?

我想,你必须使用一个非贪婪的正则表达式。将
*
替换为
*?

RewriteRule ^(.*?)/(.*?)/(.*?)/(.*?)\.html index.php?a=$1&b=$2&c=$3&d=$4 [QSA,L]

我想,你必须使用一个非贪婪的正则表达式。将
*
替换为
*?

RewriteRule ^(.*?)/(.*?)/(.*?)/(.*?)\.html index.php?a=$1&b=$2&c=$3&d=$4 [QSA,L]

其他的也要适当。

谢谢!成功了!感觉有点傻,我自己找不到。我没必要感到难过。我花了很多很多年的时间去学习,我现在所知道的。我还在学习。这就是我在这里回答问题的原因。:-)谢谢成功了!感觉有点傻,我自己找不到。我没必要感到难过。我花了很多很多年的时间去学习,我现在所知道的。我还在学习。这就是我在这里回答问题的原因。:-)