htaccess question
| From: | Al | Date: | Tue, 09 Apr 2013 18:07:53 +0000 |
| Subject: | htaccess question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-320803@lists.php.net to get a copy of this message | ||
I know it's not a php question, but I can't readily find the answer elsewhere.
I want to make this directive universal. Put htaccess file on any host in any folder.
This works
RewriteEngine On
RewriteCond %{SERVER_PORT} !=443
RewriteRule ^(.*)$ https://www.foo.org/bar/$1 [R=301,L] #Here the foo.org and /bar must be specified
I want what is in effect
RewriteRule ^(.*)$ https://{host_name}/{directory}/$1 [R=301,L]
I can easily do this with php regex capturing the (host and dir) and then rewriting the text string; but the Apache directives are not obvious.