|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#16
|
||||
|
||||
|
Example 6: domain.com/foo.html -> www.domain.com/foo.html (forcing "www")
Code:
RewriteCond %{HTTP_HOST} !^www [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Code:
http://domain.com -> http://www.domain.com Related Threads: only prefix www if no other subdomain exists, RE: Example forcing "www" Last edited by jharnois : November 22nd, 2005 at 01:10 AM. Reason: Added related thread. |
|
#17
|
||||
|
||||
|
http://domain.com -> https://domain.com (forcing "https")
Code:
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
Code:
http://domain.com/foo.html -> https://domain.com/foo.html Related Threads: Redirect to secure URL, Force HTTPS on secure.domain.com Last edited by jharnois : July 20th, 2007 at 07:26 PM. Reason: Added related thread. |
| Viewing: Dev Shed Forums > System Administration > Apache Development > MOD REWRITE Guide & Common Requests |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|