URL Rewriting on GoDaddy Virtual Server
Posted
by Aristotle
on Server Fault
See other posts from Server Fault
or by Aristotle
Published on 2010-05-25T19:33:57Z
Indexed on
2010/05/25
19:41 UTC
Read the original article
Hit count: 670
I migrated a Kohana2 application from a shared-hosting environment over to a virtual dedicated server. After this migration, I can't seem to get my .htaccess file working again. I apologize up front, but over the years I have never experienced so much frustration with anything else as I do with the dreaded .htaccess file. Presently I have my project installed immediately within a directory in my public folder:
/var/html/www/info.php (general information about server) /var/html/www/logo.jpg (some flat file) /var/html/www/somesite.com/[kohana site exists here]
So my .htaccess file is within that directory, and has the following contents:
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase /somesite.com/
# Protect application and system files from being viewed
# This is only necessary when these files are inside the webserver document root
RewriteRule ^(application|modules|system) - [R=404,L]
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php?kohana_uri=$0 [PT,QSA,L]
# Alternativly, if the rewrite rule above does not work try this instead:
#RewriteRule .* index.php?kohana_uri=$0 [PT,QSA,L]
This doesn't work. The initial controller is loaded, since index.php is called up implicitly when nothing else is in the url. But if I try to load up some other non-default controller, the site fails. If I place the index.php back within the url, the call to other controllers works just fine.
I'm really at my wits end, and would appreciate some direction here.
© Server Fault or respective owner