Re: Using .htaccess to force rewriting URLs to https:// works but loses any subdirectory paths. What do I need to change?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bob Linkonij wrote:
[snip]

Reading around alot, I made some progress by putting this in the
/webroot/.htaccess file:

	Options +FollowSymLinks
	
	SSLOptions +StrictRequire
	SSLRequireSSL
	SSLRequire %{HTTP_HOST} eq "www.Domain.com"
	ErrorDocument 403 https://www.Domain.com
	
	RewriteEngine      on
	RewriteBase        /
	
	RewriteCond %{HTTPS} !=on
	RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

You don't need to use REQUEST_URI (maybe it's not available in the context of RewriteRule?). You can just capture the results of RewriteRule match.

RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]


--
Justin Pasher

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux