2

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.

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

Ian Muscat
  • 235
  • 3
  • 15

3 Answers3

0

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.

Sumana Mehta
  • 2,663
  • 1
  • 14
  • 10
  • Thanks for your reply . No, I'm not using OpenShift action_hooks. I took the fast route and had OpenShift create a WP installation from the GitHub repo ie: I didn't bother installing WP myself - everything was set-up automatically by OpenShift. I don't know if that may be the root to the issue. I'll try and look further into this. If i find a solution I'll post it here... – Ian Muscat Apr 06 '13 at 14:59
0

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.

0

Try putting .htaccess file to the git ignore

Tejas Shah
  • 55
  • 9