Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.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 如何使用html扩展将URL重写为querystring和ilas名称?_Php_.htaccess - Fatal编程技术网

Php 如何使用html扩展将URL重写为querystring和ilas名称?

Php 如何使用html扩展将URL重写为querystring和ilas名称?,php,.htaccess,Php,.htaccess,如何通过.htacess重写以下URL: “”到“” 及 “”到“” 谢谢。看一看。它将允许您更改URL对用户的显示方式,同时仍在后端调用正确的脚本。这包括屏蔽任何PHP URL以显示为.html。一个可能的解决方案(尽管可能需要一些工作;请将其放在.htaccess文件中): 另请参见:这是一条简单的规则,包含mod\u rewrite: 通过httpd.conf启用mod_rewrite和.htaccess,然后将此代码放入文档根目录下的.htaccess: Options +FollowS

如何通过.htacess重写以下URL:

“”到“”

“”到“”

谢谢。

看一看。它将允许您更改URL对用户的显示方式,同时仍在后端调用正确的脚本。这包括屏蔽任何PHP URL以显示为
.html
。一个可能的解决方案(尽管可能需要一些工作;请将其放在
.htaccess
文件中):


另请参见:

这是一条简单的规则,包含
mod\u rewrite

通过
httpd.conf
启用mod_rewrite和.htaccess,然后将此代码放入
文档根目录下的
.htaccess

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteRule ^blog\.html$ /blog/ [L,NC]

RewriteRule ^this-is-ilas\.html$ /general.php?code2 [L,NC,QSA]

这是评论,不是回答!问题是“如何重写URL”。“使用mod_rewrite”似乎是对上述问题的恰当回答。我希望general.php?=2到ilas.htmlp的可能副本
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteRule ^blog\.html$ /blog/ [L,NC]

RewriteRule ^this-is-ilas\.html$ /general.php?code2 [L,NC,QSA]