-1
我試着去我的網址路徑更改來自:如何更改url路徑並擁有http:// instad of http?
example.com/path/index.php
或
http://example.com/path/index.php
到
https://example.com/
-
和
www.example.com/path/index.php
或
http://www.example.com/path/index.php
到
https://www.example.com/path/index.php
這是我到目前爲止,它工作正常,爲https://開頭的一部分,但不是改變我的URL路徑
。 htaccess文件
#First rewrite any request to the wrong domain to use the correct one (here www.)
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#Now, rewrite to HTTPS:
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#Change to/instead of /path/index.php (Doesn't work.)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ path/index.php?/$1 [L]
我爲此道歉,是的。我正在這樣做,所以它將所有內容重定向到www。並且我粘貼了錯誤的代碼(www。版本),這並不重要。我的主要觀點是強制https並更改url路徑/提示頁面。 – ErroR