apache - Handling subdomains and https with .htaccess -


In the .htaccess example below, if there are any of the following types in the URL ...

< / P>

... This will automatically load the page from the subdirectory of the ExDom under Public_Html, named "Racks-Motorcycle". This technique is called proxy throughput .

  Revive Engines on Rewrite Rules ^ ricks-motorcycles /(.*)$ http://x.com/ricks-motorcycles/$1 [P, L]  

It's great, but how do I manage two other situations:

(1) Anyone should have https instead of http.

(2) Someone wants ...

http # // ricks-motorcycles.mysite.com /

... instead ...

http # // mysite.com/ricks-motorcycles/

(from top: switch # because the stack overflow was blocking me from posting.)

< / Div>

You can get your writing ability with a RewriteCond :

  RewriteEngine On RewriteCond% {HTTPS} = on RewriteRule ^ ricks-motorcycles /(.*)$ https://example.com/ricks-motorcycles/$1 [P, L] Rivet condom% {HTTP_HOST} = Rix-motorcycle. MISIT Act Rev. ^ (. *) $ Http: //example.com/ricks-motorcycles/$1 [P, L]  

For more information, see.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -