php - 如何使用 .htaccess 删除 url 之间的扩展名

标签 php .htaccess seo

请先告诉我: http://www.example.com/en.html/spirit-levels/type-70

以上网址是否对 SEO 友好?

如果没有,请告诉我如何使用 .htaccess 从上面的 url 中删除 .html。

谢谢

最佳答案

Can I know which framework you are using
 or used  below code in .htaccess placed in root of your application

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
#.php .html or other


if you are using any framework like codeigniter just open config.php in config folder and use below code

$config['url_suffix'] = ''; // make it blank

关于php - 如何使用 .htaccess 删除 url 之间的扩展名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38761940/

相关文章:

.htaccess - 在 SYMFONY 中仅使用 HTACCESS 强制 HTTPS

wordpress - 如何阻止过度访问我的网站的机器人?

seo - 如何让搜索引擎在我的网站上找到博客?

heroku - robots.txt 和禁止绝对路径 URL

php - 可以在查询字符串值中使用连字符吗?

java - 通过 Nexmo API 将回调 URL 分配给短信号码

php - 确定字符串是否为图像、youtube 等的最佳方法

php - 意外的 token A

.htaccess - 如何将所有请求重定向到 laravel 5 中的 public/文件夹

html - 从谷歌搜索中删除动态生成的网址