.htaccess
Aus Mein Wiki
Sebra  (Diskussion | Beiträge)  (→Samples)  | 
		Sebra  (Diskussion | Beiträge)   (→Cheat Sheets)  | 
		||
| Zeile 19: | Zeile 19: | ||
* http://www.askapache.com/htaccess/modrewrite-tips-tricks.html  | * http://www.askapache.com/htaccess/modrewrite-tips-tricks.html  | ||
| + | |||
| + | * http://www.workingwith.me.uk/articles/scripting/mod_rewrite  | ||
| + | |||
| + | * http://www.kb.mediatemple.net/questions/85/Using+.htaccess+rewrite+rules#gs  | ||
| + | |||
| + | == Tools ==  | ||
| + | * Mod Rewrite Generator  | ||
| + | ** http://www.generateit.net/mod-rewrite/  | ||
| + | |||
== Samples ==  | == Samples ==  | ||
| Zeile 36: | Zeile 45: | ||
  #differently. If you want you can add an extra parameter too, like:  |   #differently. If you want you can add an extra parameter too, like:  | ||
  RewriteRule /path/index.php /path/iphone.php?extra=param [QSA,L]  |   RewriteRule /path/index.php /path/iphone.php?extra=param [QSA,L]  | ||
| + | |||
| + |  RewriteCond %{REQUEST_FILENAME} !-f  | ||
| + |  RewriteCond %{REQUEST_FILENAME} !-d  | ||
| + |  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]  | ||
=== subdomain to folder/directory ===  | === subdomain to folder/directory ===  | ||
| Zeile 51: | Zeile 64: | ||
=== ... ===  | === ... ===  | ||
| - | ###################################################  | + |  ###################################################  | 
| - | # Turn the RewriteEngine on.                      #  | + |  # Turn the RewriteEngine on.                      #  | 
| - | ###################################################  | + |  ###################################################  | 
| - | + |  RewriteEngine on  | |
| - | RewriteEngine on  | + |  ###################################################  | 
| - | + |  # Add a leading www to domain if one is missing.  #  | |
| - | ###################################################  | + |  ###################################################  | 
| - | # Add a leading www to domain if one is missing.  #  | + |  # If this rule is used, the rewriting stops here  #  | 
| - | ###################################################  | + |  # and then restarts from the beginning with the   #  | 
| - | # If this rule is used, the rewriting stops here  #  | + |  # new URL                                         #  | 
| - | # and then restarts from the beginning with the   #  | + |  ###################################################  | 
| - | # new URL                                         #  | + | |
| - | ###################################################  | + | |
RewriteCond %{HTTP_HOST} !^www\.  | RewriteCond %{HTTP_HOST} !^www\.  | ||

