根据当前htaccess编写一段php代码作为seo永久链接url
下面是一个著名的 .htaccess
示例
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
,据我所知,URL 的结果将是
http://domain.com/about.php will be http://domain.com/about/
http://domain.com/contact.php will be http://domain.com/contact/
示例,我的 URL 是 http://domain.com/page.php?id=1
如何根据上面的 .htaccess
在 PHP 中编写 URL 为 http://domain.com/page-name/
的代码。
Below is example a famous .htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
What I know here, the result for URL will be
http://domain.com/about.php will be http://domain.com/about/
http://domain.com/contact.php will be http://domain.com/contact/
Example my URL is http://domain.com/page.php?id=1
How to write a code in PHP which the URL will be http://domain.com/page-name/
according to the .htaccess
above.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是您搜索的内容
http://domain.com/testname/ 将被翻译为 http://domain.com/page.php?name=testname
this is what you search for
http://domain.com/testname/ will be translated to http://domain.com/page.php?name=testname