views:

51

answers:

2

I have installed a PHP program onto my godaddy shared host (linux) account. I am now getting 404 errors. I have contacted support for the program but have not heard back. From what I am reading on various forums, there seems to be an implication that I need to change something in the .htaccess file.

The only .htaccess file is in the "jem" (this is the folder for the program) folder (which is in public_html), and it says:

#Options -Indexes
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?/$1 [L]
</ifModule>

Does anyone have any ideas as to why I am getting 404 errors? Thx in advance!

A: 

You mentioned that the application in installed in subfolder of your hosting environment, not the document root, so you probably need to set the RewriteBase directive. This will tell mod_rewrite that it is not working in the doc root, but a directory.

Simply add:

RewriteBase /path/to/app

After the RewriteEngine On line.

In your case, /path/to/app should most likely be where ever your .htaccess file is, relative to your document root. So, if your domain is example.com and your app is installed at example.com/application, the path should be /application.

jason