for .htaccess/mod_rewrite gurus or pros ^^
i've got the following
it is currently sitting at "/dir/.htaccess" .... i got two things that i would like to do...
1) how do i port this out to sit on the root "/" directory? (but make the rule only apply for a certain "/dir")
2) the current rule doesn't work if i enter "http://www.domain.com/dir" (w/o the trailing slash) ...instead of "http://www.domain.com/dir/" (which works). any fix?
TIA.
ps. or will it be easier to have another .htaccess file in the dir i want to redirect http to https traffic to? if so, any pointers would help as well.
i've got the following
Code:
RewriteEngine on
# SERVER_PORT <> Port:443
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*) https://%{HTTP_HOST}/dir/$1 [R=301,L]
1) how do i port this out to sit on the root "/" directory? (but make the rule only apply for a certain "/dir")
2) the current rule doesn't work if i enter "http://www.domain.com/dir" (w/o the trailing slash) ...instead of "http://www.domain.com/dir/" (which works). any fix?
TIA.
ps. or will it be easier to have another .htaccess file in the dir i want to redirect http to https traffic to? if so, any pointers would help as well.
