I had an issue today with a wordpress installation that I’ve seen a few times and finally figured out how to fix (it’s *facepalm* easy!)
The Problem
When I installed wordpress on an addon domain through Fantastico Deluxe in the Cpanel area of a Hostgator Hatchling account (try saying that 10 times fast!), the domain would change from
http://targetdomain.com
to
http://targetdomain.hostdomain.com
or
http://hostdomain.com/targetdomain.com
It has only ever happened with the Hatchling account on Hostgator.
I tried all the solutions offered on different forums, tried reinstalling, checking config.php, etc. It was so frustrating! I wasted hours trying to find the solution and some projects were pushed back that should have been well on their way by now. I had a temporary workaround for a few sites, but that wasn’t good enough.
Finally figured out how to fix it easily and without the workaround.
The Solution
For some reason, installing wordpress through Fantastico Deluxe for an addon domain didn’t also install a .htaccess file. Usually this doesn’t matter. Sometimes you’ll have a .htaccess file there already and wordpress just amends it.
The fix is to install wordpress as normal, through Fantastico Deluxe, then upload a .htaccess file to your targetdomain.com root with the standard wordpress rewrite in it. Just copy and paste the following into a text document:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule># END WordPress
Then save as .htaccess (that’s without a file name and the extension is htaccess, rather than say txt or doc).
Upload it via ftp (use Filezilla if you don’t have an ftp program, or just do it through the file manager in Cpanel). Then login to http://targetdomain.com/wp-admin/ and it will work as it should. Doh!
If this doesn’t fix it for you, please let me know in the comments and I’ll try to help you figure it out.
Leave a Reply