Note: I think this question has been asked before but no clear solutions have been discovered.

I had developed a site in PHP that uses clean URLs:

For example:


I had .htaccess file redirect every request to index.php, which decides which content to send to browser by looking up the query string:

# Turn on URL rewriting
RewriteEngine On

# Protect application and system files from being viewed
RewriteRule ^(includes|model) - [F,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/
RewriteRule .* index.php/$0 [PT,L]

This worked well until the hosting package got expired and I was asked to move the site to an existing GoDaddy account that hosts multiple domains under one hosting by creating subdirectories under root site and adding unlimited number of addon domains. This setup broke my site.

Now I am getting this in browser:

Not Found

The requested URL /directoryname/home was not found on this server.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

The original .htaccess is already there. After reading around, I also added following to root site .htaccess:

addhandler x-httpd-php5-cgi .php
addhandler x-httpd-php5-cgi .php5

But still no avail. Is there a solution that can allow using URL rewriting on a GoDaddy hosting setup with multiple domains under one account?

  • Could you elaborate more how the link structure has changes from the old setup to the new setup? For example one link was www.example.com/about-us are the links still like that in the new setup? Or is it like www.example.com/directoryname/about-us (maybe even with another domain)? – vstm Sep 11 '13 at 18:20
  • @vstm Links themselves are supposed to remain same, but the directory would change. In old setup the site was stored on root directory, while in this it is stored in a subdirectory of the main domain of the account. Like this: / (maindomain.com files) /XYZABC22 (thissite.com files) /FOOBAR99 (anothersite.com files) Other too are added as addon domains, for which GoDaddy pulls files from a subdirectories within the main account directory. – excitive Sep 12 '13 at 2:49
  • thank you for the clarification. I assume there's already a .htaccess with RewriteRules in the / (root-directory)? If that's the case then maybe those rules are "overriding" the rules in the /XYZABC22/.htaccess. Have you tried adding the line RewriteEngine off directly before the RewriteEngine on-line? This AFAIK "flushes" the inherited RewriteRules. If that doesn't work I would try to add RewriteOptions Inherit - this would put the inherited parent rules after the child rules. – vstm Sep 12 '13 at 5:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.