1
我有一個角度項目與html5模式的路線。我設置了一個htaccess文件,可以手動插入域或刷新頁面。多重htaccess重寫條件/角路由html5模式
這裏htaccess的代碼精品工程,在此基礎上 Still getting 'Not Found' when manually refreshing with angular.js route
RewriteEngine On
RewriteBase/
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule^- [L]
RewriteRule^myFolder/myFile.php [L]
,但現在我想也重定向URL到https寬WWW,例如:
http://example.com應該成爲https://www.example.com
那裏我爲此使用了:
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
但是,當我嘗試結合這些腳本,我總是得到錯誤!
謝謝!
非常感謝,它的工作完美! – miholzi
沒問題。很高興它解決了。 –