I have been at this for 3 hours and cannot seem to get mod_rewrite
to work with GoDaddy on a shared server under a subdomain. I have an app in a subdirectory and I've used the same rules before on multiple servers so I know they work. Here's what I've got:
PHP Version 5.3.10-1 Ubuntu3.6
subdomain root/
-.htaccess
--appdir/
---.htaccess
----public/
-----.htaccess
subdomain root/.htaccess
Options -Multiviews
That's it for the document root .htaccess
, many have suggested to do this with GoDaddy servers.
appdir/.htaccess
Options -Multiviews
RewriteEngine on
RewriteBase /appdir
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]
This routes all requests to the appdir/public
directory
appdir/public/.htaccess
Options -Multiviews
RewriteEngine On
RewriteBase /appdir/public ### also tried just adding /appdir ###
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [PT,L]
ErrorDocument 404 index.php
Just to be sure mod_rewrite
was available, I ran sudo a2enmod rewrite
from Bash and checked after restarting apache with print_r(apache_get_modules());
and sure enough it's there so needless to say I'm at a complete loss as to what the problem may be. Anyone have similar experiences with GoDaddy and have suggestion on what to do to get mod_rewrite
running? Thanks in advance.