ApacheRedirects
Redirect
This is a basic redirect. It redirects one page to another. In the case of this site, this is what is used bring up the twiki site as the front page. Add to .htaccess
Redirect permanent /index.html http://4096k.net/cgi-bin/twiki/bin/view/Main/WebHome
This does not rewrite the URL. Just a simple redirect.
Mod Rewrite
This uses Apache mod_rewrite to do about the same thing, but mod_rewrite may not be turned on in the server.
RewriteEngine on
RewriteRule ^/$ /cgi-bin/twiki/bin/view/Main/WebHome/ [R]
Mod Rewrite V2
My webhost seems to have issues with some
RewriteRules? . In addition, the IRMs on this account cause other problems with the above Mod Rewrite. He is what I am currently using.
RewriteEngine on
#change www to none www url
RewriteCond %{HTTP_HOST} ^www.4096k.net
RewriteRule (.+) http://4096k.net/$1 [R=301,L]
#redirect for twiki, ya it's a hack
RewriteCond %{REQUEST_FILENAME} !twiki
RewriteCond %{HTTP_HOST} ^4096k\.net
RewriteRule ^(.*)$ http://4096k.net/cgi-bin/twiki/bin/view/Main/WebHome [R=301,L]
This has it's own problems. The first
ReWriteCond? checks to see if the word "twiki" is NOT in the URL and the second checks to make sure it's on the host 4096k.net. Then rewrite the url to the longer twiki url. This works, but will fail when when files are called outside the "twiki" directory.
--
PorchLight - 01 Sep 2007