Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /www/htdocs/v166574/fusca/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /www/htdocs/v166574/fusca/wiki/includes/MagicWord.php on line 671

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /www/htdocs/v166574/fusca/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /www/htdocs/v166574/fusca/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /www/htdocs/v166574/fusca/wiki/includes/MagicWord.php on line 671

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /www/htdocs/v166574/fusca/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /www/htdocs/v166574/fusca/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /www/htdocs/v166574/fusca/wiki/includes/MagicWord.php on line 671

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /www/htdocs/v166574/fusca/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /www/htdocs/v166574/fusca/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /www/htdocs/v166574/fusca/wiki/includes/MagicWord.php on line 671

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /www/htdocs/v166574/fusca/wiki/includes/MagicWord.php on line 675
.htaccess – Mein Wiki

.htaccess

Aus Mein Wiki

Wechseln zu: Navigation, Suche
(Url-Rewriting / Speaking-Urls mit .htaccess)
(Cheat Sheets)
Zeile 15: Zeile 15:
* http://stackoverflow.com/questions/2803040/apache-rewrite-mod-rewriterule-path-and-query-string
* http://stackoverflow.com/questions/2803040/apache-rewrite-mod-rewriterule-path-and-query-string
-
** Sample:
 
-
RewriteEngine On
+
 
-
RewriteCond %{HTTP_USER_AGENT} ^.*mobile.*$ [NC]
+
-
RewriteRule /path/index.php /path/iphone.php [QSA,L]
+
-
#EDIT: QSA is Query string append, so you don't need to handle that 
+
-
#differently. If you want you can add an extra parameter too, like:
+
-
RewriteRule /path/index.php /path/iphone.php?extra=param [QSA,L]
+
* http://www.askapache.com/htaccess/modrewrite-tips-tricks.html
* http://www.askapache.com/htaccess/modrewrite-tips-tricks.html
 +
== Samples ==
-
** Sample:
 
  #Sending requests to a php script ^
  #Sending requests to a php script ^
  #This .htaccess rewrite example invisibly rewrites requests for all Adobe pdf  
  #This .htaccess rewrite example invisibly rewrites requests for all Adobe pdf  
  #files to be handled by /cgi-bin/pdf-script.php
  #files to be handled by /cgi-bin/pdf-script.php
  RewriteRule ^(.+)\.pdf$  /cgi-bin/pdf-script.php?file=$1.pdf [L,NC,QSA]
  RewriteRule ^(.+)\.pdf$  /cgi-bin/pdf-script.php?file=$1.pdf [L,NC,QSA]
 +
 +
#Redirects all files that end in .html to be served from filename.php so it
 +
#looks like all your pages are .html but really they are .php
 +
RewriteRule ^(.*)\.html$ $1.php [R=301,L]
 +
 +
RewriteEngine On
 +
RewriteCond %{HTTP_USER_AGENT} ^.*mobile.*$ [NC]
 +
RewriteRule /path/index.php /path/iphone.php [QSA,L]
 +
#EDIT: QSA is Query string append, so you don't need to handle that 
 +
#differently. If you want you can add an extra parameter too, like:
 +
RewriteRule /path/index.php /path/iphone.php?extra=param [QSA,L]
= Authentifizierung mit .htaccess =
= Authentifizierung mit .htaccess =

Version vom 01:49, 18. Jun. 2013

Persönliche Werkzeuge