Rewrite fails

Posted December 11, 2013 4.6k views
I'm not able to get certain redirects to work, which worked when the sites were on a shared host. This fails: RewriteCond %{HTTP_HOST} ^ [NC] RewriteRule ^(.*)$$1 [L,R=301] Entering gives zpanel..... What am I doing wrong on the setup of the droplet?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
7 answers
Why use Apache, when WordPress best-practices recommend Nginx?

If you really want to stick w/Apache, check out: htaccess | WordPress Codex.
Sorry, but I tried nginx months ago and the permalinks were completely messed up.

I'm well aware of the .htaccess rules and as I stated this worked on a shared hosting but does not work on the DO droplet. Something is stopping the redirect. I see I asked this question another way in August too and wasn't given any resolution.
It seems that zPanel is causing this, did you add to zPanel? is in zpanel as a domain with the same directory as is set to roll to by WordPress domain mapping is set forward to by GoDaddy

I must have a setting somewhere causing this problem but don't know where to look. is set forward to by GoDaddy

There's your problem. GoDaddy shouldn't handle that. Add it to zPanel as an addon domain for your existing domain name so that it shares the same files. Then based on your .htaccess rules it should redirect to the correct domain.

Unfortunately this did not work. I decided to retry my hands with nginx. The WordPress and XenForo portions load fine. I'm now working on the mediawiki install.

Sadly - this destroys zpanel. Interestingly the roll over still does not work.
Sadly - this destroys zpanel.

That's a good thing in my opinion. ;) I don't recommend using control panels unless you're reselling hosting where clients want an easy-to-use control panel. Plus, they usually drain a lot of resources such as memory since your server needs to run the control panel as well. Eventually you'll be more comfortable with the command line and prefer it to control panels.

Let me know how it goes!