Reputation: 1398
i have problem with redirecting login page to https when i do this way:
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTPS} off
RewriteRule ^login https://sklep.galmet.com.pl/login [L,R=301]
# otherwise forward it to index.php
RewriteRule . index.php
this works when i go to shop.abcdomain.com.pl/logn
im redirected to https://shop.abcdomain.com.pl/logn
but all files like .css
, .jpeg
and so on are not loaded i think its because of this line RewriteRule . index.php
but i don't know how to resolve this
Upvotes: 0
Views: 73
Reputation: 1760
RewriteCond will only apply to the first rule it comes to.. so your check for file / directory won't apply to not passing to index.php. try this:
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTPS} off
RewriteRule ^login https://sklep.galmet.com.pl/login [L,R=301]
# otherwise forward it to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
Upvotes: 1
Reputation: 41
Add this in to your apache .htcaccess file
1. - options FollowSymLinks
2. - options +Multiviews
Upvotes: 0
Reputation: 1101
Link all your assets(css/js) file with '/' at beginning, and it should work fine.
Upvotes: 0