Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

htaccess seems to be overwritten during installation? #57

Closed
JCB-K opened this issue Feb 14, 2012 · 5 comments
Closed

htaccess seems to be overwritten during installation? #57

JCB-K opened this issue Feb 14, 2012 · 5 comments
Assignees
Milestone

Comments

@JCB-K
Copy link

JCB-K commented Feb 14, 2012

I ran into this issue because Hostgator requires a line in .htaccess to enable PHP 5.3. When I filled in my details and submitted the setup form it warned me that Anchor needs PHP 5.3. When I checked the htaccess it was completely empty. By pasting in the original line for PHP 5.3 and the Anchor Rewrite rules I got it to work again.

Just realised this also meant that I skipped creating an admin user...

@saltandvinegarcrisps
Copy link
Member

What would you suggest?

When a user selects clean urls the installer copies the htaccess.txt contents to the .htaccess file with the rewrite base if anchor is installed in a subfolder.

@JCB-K
Copy link
Author

JCB-K commented Feb 15, 2012

Not sure if this is possible, but maybe use FILE-APPEND, so it just adds it to the existing file? I've done this locally, and it manages to write the htaccess in a clean manner, but the installer still gets stuck. I'll let you know about any progress.

@saltandvinegarcrisps
Copy link
Member

I think the best option is to leave the existing htaccess file and the user will have to manually update it to enable clean urls. We cant append and assume its safe to do so.

@JCB-K
Copy link
Author

JCB-K commented Feb 15, 2012

Read a bit up on it, and the general consensus seems to be that web apps should never edit the .htaccess for exactly that reason. The thing is, by not automating it you're adding another step to the install process. But potentially breaking someone's server setup is not worth eliminating that step.

Maybe let it only write the .htaccess when it doesn't exist yet (as in the dev branch right now), and otherwise give a warning along the lines of:

"It seems like you've already got a htaccess file. Paste this text at the end of your file to setup clean url's."

@saltandvinegarcrisps
Copy link
Member

I agree. Updated in dev branch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants