0
我遇到了与用户in this thread.相同的问题我基本上想要使用htaccess
将所有http请求重定向到https,而不使用www。使用URI重定向到HTTPS而没有www
我已经实施了一个solution to this problem,它做得很好。
但是,它不会重定向到相应的URI。如果我访问我的网站在端口80 example.com/news
我将被重定向到https://example.com/index.php
这基本上是根页..
我真的需要你的帮助球员,我完全没有关于htaccess的线索..
编辑这是我的mod_rewrite的样子..
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule^index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
那么,如果你没有发布你的动态配置文件的当前代码,那么你希望我们如何提供帮助? – arkascha
@arkascha我更新了我的帖子。 – Dean
问题_probably_是您首先重写为'index.php',然后_then_进行外部重定向。尝试改变规则的顺序。请注意,'L'标志仅终止了_current_遍历规则集。之后重新启动。 – arkascha