【发布时间】:2011-10-14 10:16:58
【问题描述】:
我在我的 htaccess 文件中进行了重写,从 url 中删除了 index.php
RewriteEngine on
RewriteCond $1 !^(images|media|system|themes|_css|_js|favicon\.ico|robots\.txt|cert\.html|index\.php) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]
除此之外,我想对任何没有两者的请求强制使用 www 和 https。
所以最终所有的 url 应该是这样的:https://www.example.com/whatever/something/;并且出于 SEO 的目的,如果一个 url 错过了标记,它应该 301 重定向到它的正确版本,例如:
http://example.com/about/
301 redirect to
https://www.example.com/about/
希望得到一些帮助,谢谢!
【问题讨论】:
标签: apache .htaccess mod-rewrite https litespeed