在下面的.htaccess例如,如果有人类型类似如下的URL ......
In the .htaccess example below, if someone types in a URL like the following...
mysite/ricks-motorcycles
...它会自动从x的子目录页面public_html下称里克斯 - 摩托车。这种技术被称为的代理吞吐的。
...it will automatically load the page from x's subdirectory under public_html called "ricks-motorcycles". This technique is called Proxy Throughput.
RewriteEngine On RewriteRule ^ricks-motorcycles/(.*)$ x/ricks-motorcycles/$1 [P,L]这是伟大的,但我怎么处理其他两种情况:
This is great, but how do I handle two other situations:
(1)有人想HTTPS代替HTTP。
(1) Someone wanting https instead of http.
(2)有人想...
HTTP#// ricks-motorcycles.mysite /
http#//ricks-motorcycles.mysite/
...
HTTP#// mysite/ricks-motorcycles /
http#//mysite/ricks-motorcycles/
(开关#有:以上是因为计算器是可以发布挡住我)
(Switch # with : above because StackOverflow was blocking me from posting.)
推荐答案您可以限定你重写了的RewriteCond :
RewriteEngine On RewriteCond %{HTTPS} =on RewriteRule ^ricks-motorcycles/(.*)$ example/ricks-motorcycles/$1 [P,L] RewriteCond %{HTTP_HOST} =ricks-motorcycles.mysite RewriteRule ^(.*)$ example/ricks-motorcycles/$1 [P,L]有关详细信息,请参见 mod_rewrite的文档。
For more information, see the mod_rewrite documentation.
更多推荐
处理子域和https使用的.htaccess
发布评论