1

So this is not my first craft build, and basically, it's identical to my last setup on the craft front, I can't see anything wrong, but I can't remove index.php without causing a 404. I've tried the .htaccess fix, not luck. The last site I did simply had "deny from all" in .htaccess, but it didn't need index.php, so I don't see why I would need to change that for it to work? Is there anywhere else I can look for a settings change that might allow for cleaning up the urls?

  • Can you post the contents of your .htaccess file in your public HTML folder? – Brad Bell Sep 29 '14 at 21:03
  • Which highlights my rookie error, wrong .htaccess file! Cheers Brad! – David Martin Sep 29 '14 at 21:06
  • Hah... happens to the best of us. Can you post that as an official answer? – Brad Bell Sep 29 '14 at 21:19
3

Check and make sure your .htaccess file is in your public HTML folder public/.htaccess!

If you do not include your .htaccess file in your public folder, Craft will display your home page properly, but all other pages will fail to load unless you add index.php?p= in your URL.

Without .htaccess:
http://website.com/mypagethatreallyexists = 404

Without .htaccess:
http://website.com/index.php?p=mypagethatreallyexists = Your page

With .htaccess:
http://website.com/mypagethatreallyexists = Your page

| improve this answer | |
1

Try setting omitScriptNameInUrls to true in your craft/config/general.php file.

| improve this answer | |
  • 1
    Yeah tried it, it gets rid of it when I use links but then just throws up a 404 since it's not directing properly...does that make sense? – David Martin Sep 29 '14 at 21:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.