Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/253.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重新编写URL_Php_Url_Url Rewriting - Fatal编程技术网

用PHP重新编写URL

用PHP重新编写URL,php,url,url-rewriting,Php,Url,Url Rewriting,我试图在我的PHP应用程序中实现URL重写。有人可以分享一个在PHP中实现URL重写的分步过程吗 在我的应用程序中,我想实现以下URL重写 http://example.com/fast-five http://example.com/300 http://example.com/13-b 从 还有一件事根据SEO、管理和应用程序的观点,以下两种类型中哪种URL最好。当然 http://example.com/fast-five http://example.com/fast-five 当然对

我试图在我的PHP应用程序中实现URL重写。有人可以分享一个在PHP中实现URL重写的分步过程吗

在我的应用程序中,我想实现以下URL重写

http://example.com/fast-five
http://example.com/300
http://example.com/13-b

还有一件事根据SEO、管理和应用程序的观点,以下两种类型中哪种URL最好。

当然

http://example.com/fast-five http://example.com/fast-five 当然对搜索引擎优化有好处

http://example.com/fast-five http://example.com/fast-five
将有利于SEO

您是否通过Apache HTTP服务器安装为PHP提供服务?如果是:

RewriteRule ^/fast-five$ /movie-download.php?nm=fast-five [R=301]

从搜索引擎优化的角度来看,首选第一种。使用HTTP 301(“永久移动”)最有效。

您是否通过Apache HTTP服务器安装为PHP提供服务?如果是:

RewriteRule ^/fast-five$ /movie-download.php?nm=fast-five [R=301]

从搜索引擎优化的角度来看,首选第一种。使用HTTP 301(“永久移动”)是最有效的方法。

如果您使用的是像CakePHP这样的MVC框架,您应该查看。否则,您可以使用web服务器。

如果您使用的是像CakePHP这样的MVC框架,您应该查看。否则,您可以使用web服务器。

正确的方法是使用零php。htaccess对于apache来说已经足够了:这将是一个询问SEO好处的好地方,仅供参考。请参阅正确方法的可能副本,其中包括零php。htaccess对于apache来说已经足够了:仅供参考,这将是一个询问SEO好处的好地方