/docs/MyDocs

To get this branch, use:
bzr branch http://darksoft.org/webbzr/docs/MyDocs

« back to all changes in this revision

Viewing changes to Administration/Linux/daemons/apache/mod_rewrite.txt

  • Committer: Suren A. Chilingaryan
  • Date: 2009-04-09 03:21:08 UTC
  • Revision ID: csa@dside.dyndns.org-20090409032108-w4edamdh4adrgdu3
import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
    *   How can I use relative hyperlinks to switch between HTTP and HTTPS? 
 
2
[L]
 
3
 
 
4
      Usually you have to use fully-qualified hyperlinks because you have to
 
5
change the URL scheme. But with the help of some URL manipulations through
 
6
mod_rewrite you can achieve the same effect while you still can use relative
 
7
URLs:
 
8
 
 
9
    RewriteEngine on
 
10
    RewriteRule   ^/(.*):SSL$   https://%{SERVER_NAME}/$1 [R,L]
 
11
    RewriteRule   ^/(.*):NOSSL$ http://%{SERVER_NAME}/$1  [R,L]
 
12
    
 
13
 
 
14
      This rewrite ruleset lets you use hyperlinks of the form
 
15
 
 
16
    <a href="document.html:SSL">
 
17
    
 
18