
May 11th, 2005, 02:19 AM
|
|
|
|
Join Date: Apr 2007
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
mod_rewrite module
Ive looked over a few websites .... and surprisingly apache has crap documentation regarding .htaccess directives. -.- for a n00b like myself at least. im not too into .htaccess. however, id like to learn, so if anyone knows of some nice tut websites that would be awsome ^.^
the main reason im writing this post is for .htaccess URI hacks with the mod_rewrite tool. i just cant figure out how to do it -.- this is what ive got so far ....... and im not sure what any of it means ... ive commented it ^.^
Code:
*VirtualHost 1.2.3.4> // Guessing this is the IP address
ServerAdmin webmaster@domain.com // sets admin e-mail
ServerName www.domain.com // sets domain
ServerAlias domain.com *.domain.com // ??
RewriteEngine On // enables rewrite engine
RewriteCond %{HTTP_HOST} !^www // ??
RewriteCond %{HTTP_HOST} ^([^.]+) // ??
RewriteCond %{DOCUMENT_ROOT}/%1 -d // ??
RewriteRule ^/(.*) %{DOCUMENT_ROOT}/%1/$1 // ??
RewriteCond %{HTTP_HOST} ^www.ceadvisor.cz // ??
RewriteRule ^/page_(.*)_(.*).html$ http://www.domain.com/index.php?page=$1&service=$2 [L,QSA] // Rewrites the request .. this is what im looking for .. but an explination would be awsome ^.^
DocumentRoot /domains/domain.com/ // sets document root?
ErrorLog logs/domain.com.error.log // error logs
TransferLog logs/domain.com.transfer.log // FTP logs
ErrorDocument 404 /404.php // 404 request
*/VirtualHost>
basically what im trying to do is turn
http://www.domain.com/index.php?foo=var1&bar=var2
into
http://www.domain.com/var1/var2/
^.^
kind of how http://www.deviantart.com/ works.
any help would be greatly appreciated <3
im running:
redhat;
php 4.3.9;
|