I can't get rid of that pesky index.php?p= from my urls.


If I manually remove index.php?p= e.g. http://mysite.com/about/people it works, but then goes back to adding the index.php?p= as soon as I navigate away.

I've tried adding 'usePathInfo' => true, and 'omitScriptNameInUrls' => true, to general.php

PathInfo works, http://mysite.com/index.php/testPathInfo = 'success'

When I add garbage to htaccess I get server error, so htaccess works.

And I have another site with a very similar build on the same server that's working fine.

Is there anything else I can look at?

  • Have you checked to make sure index.php?p= isn't actually present in you siteUrl config variable? Commented May 29, 2015 at 9:51
  • I'm using baseUrl with {baseUrl} in Site URL in general settings, and no index.php?p= present.
    – Samsull
    Commented May 29, 2015 at 17:28
  • Is this a vanilla Apache install?
    – Brad Bell
    Commented May 29, 2015 at 17:36
  • It's on a new VPS and I've added the missing extensions to get Craft up and running. For another site on the exact same server I'm not seeing the rogue index.php
    – Samsull
    Commented May 31, 2015 at 12:09
  • If I avoid using the url link e.g. {{ aboutUs.url }} it gets rid of the index.php. For example, this works: <a href="{{ siteUrl }}about-us/{{ aboutUs.slug }}">{{ aboutUs.title }} and this doesn't: <a href="{{ aboutUs.url }}">{{ aboutUs.title }}</a> . It works by splitting up the url with a slug variable.
    – Samsull
    Commented Jun 4, 2015 at 13:22

1 Answer 1


Have you seen this on the Craft site: http://buildwithcraft.com/help/why-index.php ?

  • yes, I've tried this, I mentioned it in my post.
    – Samsull
    Commented Jun 1, 2015 at 18:10
  • This post has NOT been answered. I can only find a temporary fix.
    – Samsull
    Commented Jun 7, 2015 at 11:08
  • I have the same issue as described here. Stumped.
    – SoHo
    Commented Dec 19, 2017 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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