WordPress .htaccess on Red Hat OpenShift PaSS

I’m developing a website using WordPress on OpenShift. All is ok, except my .htaccess file. Every time I push code using Git, the .htaccess file becomes blank. Even if I push an .htaccess file from my computer through Git. This means that I have to re-configure pretty permalinks every time I push changes via Git.

I tried SSHing into the server in the directory /var/lib/stickshift/xxxxxxxx/app-root/repo/php – and indeed, before I push any code the .htaccess file is properly populated. The minute I push anything via Git (even when this includes the .htaccess file from my computer) the file is blank.

Read More

I’m wondering – perhaps does OpenShift store the .htaccess file somewhere else? But if so, why would it re-set every time I push new code?

If possible, I wouldn’t like to move the .htaccess file to a location where I can’t access via Git – since it may need to be updated in the future.

If anyone has encountered this issue and has come across a solution, any help/insight would be greatly appreciated.

Regards,

Ian

Related posts

Leave a Reply

3 comments

  1. Well yesterday itself I was playing with WordPress Multisite on OpenShift and was using .htaccess for configuring sub-directories feature. Locally in the git repo, I created .htaccess file under git_repo/php directory; git add .; git commit; git push and there after the file stayed put in tact. It appears something else is overwriting your .htaccess? Are you using OpenShift action_hooks?

    Just to be sure, I created a simple php app and used .htaccess – no wiping of contents here too. Why don’t you test this out on your end? And if the problem persists, let me know.

  2. If you are using the default wordpress for OpenShift it is automagic now.
    Just create (and git add) the .htaccess file to your .openshift/config directory.
    The deploy action_hook will copy it to the correct directory (/app-root/data/current) at deployment.