0

我的网站

对于 SEO,我.php已从所有链接中删除了扩展名。现在我想.php使用 .htaccess 文件添加扩展名。我怎么能做到这一点。我不知道使用 htaccess

4

2 回答 2

1

采用MultiViews

让 Apache 为您做这件事。

把它放在你的.htaccess文件中:

Options +MultiViews
于 2012-06-21T08:34:43.183 回答
0
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^someName-([0-9]+)\.html$ someName.php?id=$1 [NC]

这会将 */someName-f435weS.html 转发到 someName.php?id=f435weS

来源:http ://roshanbh.com.np/2008/02/hide-php-url-rewriting-htaccess.html

于 2012-06-21T08:37:02.987 回答