mod_rewrite and .htaccess: advanced tricks
It’s actually called mod_rewrite and not .htaccess! If you want to do rewrite rules have, do yopurself a favor and have first a look at the Apache documentation:
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritecond
Look inside varaible/what apache gets:
RewriteRule ^(.+)$ %{THE_REQUEST} [C]
RewriteRule ^(.+)$ /inside:$1/ [R,QSA]
…or …
RewriteCond %{REQUEST_URI} !SEE
RewriteCond %{THE_REQUEST} ^(.+)
RewriteRule ^(.+)$ /SEE:%1/ [R,QSA]
Replace THE_REQUEST with one of the variables presented here.
user1234.mystuff.de -› www.mystuff.de/account.php?user=user1234
RewriteCond %{http_host} !^www\.example\.com
RewriteCond %{http_host} ^(www\.)?(.+)\.example\.com
RewriteRule ^([0-9]+}/$ /account.php?user=%2&message=$1 [L]
Rewriting the fragment part of an URI or anker
Anyway, there is no way that you can user the fragmet part of the URI to rewrite your URL. It is internally stripped away by Apache. It’s not in REQUEST_URI nor in THE_REQUEST. You cannot use PHP nor Perl for that!
See also: http://www.tedpavlic.com/post_apache_rewriting_examples.php
UPDATE: Ah.. yeah… better look into the documentation again ;9 This could save you much time:
RewriteLog "/var/log/apache/rewrite.log"
Dezember 29th, 2009 at 23:22
Very nice site! cheap viagra