<p>This recently tripped me up. <code>'true'</code> (with quotes) is not the same as <code>true</code> (without the quotes).</p>

<p>Lose the quotes in the config file, clear Craft's caches, and it should stick.</p>

<p>Also make sure your <code>siteUrl</code> is the same as what your web server is configured as. If you have a redirect in there, say <code>www.example.com</code> goes to <code>example.com</code>, and your <code>siteUrl</code> is configured to use the former, that seems to trip up Craft's check too. </p>

CC BY-SA 3.0
2017-09-02T19:32:11.340Z
Thanks, that was it! I knew it was something stupid on my part, guess I need to take more frequent breaks.  Much appreciated!
Roi Agneta
CC BY-SA 3.0
2017-09-02T23:05:50.553Z
Mark it correct if you'd like. ;)
RitterKnight
CC BY-SA 3.0
2017-09-02T16:01:05.387Z
2017-09-02T16:08:51.987Z
2017-09-02T16:08:51.987Z
RitterKnight
<p>Have you tried everything here? <a href="https://craftcms.com/support/remove-index.php" rel="nofollow noreferrer">https://craftcms.com/support/remove-index.php</a></p>

CC BY-SA 3.0
2017-09-01T21:35:54.010Z
Yes - as I said, doing this is nothing new for me
Roi Agneta
CC BY-SA 3.0
2017-09-01T20:12:46.137Z
2017-09-01T20:12:46.137Z
andrew.welch
<p>I have built and deployed dozens of Craft sites, so I know how to remove 'index.php' from urls, but now I have a site that refuses to accept my most determined efforts to remove it.</p>

<p>This is the situation:</p>

<ul>
<li>I am using the Craft supplied .htaccess file with the same settings
as all of my other sites.</li>
<li>Just to be thorough, I added 'omitScriptNameInUrls' => 'true', to the config file</li>
<li>double checked all of the general settings in the CP and all is as it should be</li>
</ul>

<p>After trying a few things, I found that if I use {{ siteUrl }}<em>path</em> I get a clean url, but if I use {{ url('path') }} it leaves that nasty index.php in the url. The same is true for {{ entry.url }}. One last bit of puzzlement - if I manually enter a full path, e.g. <a href="http://sitename/news" rel="nofollow noreferrer">http://sitename/news</a> it works fine  </p>

<p>I suspect I am missing something obvious, but it is definitely driving me nuts!</p>

<url><siteurl>
Strange 'index.php' Issue
# Strange 'index.php' Issue

(Asked by: username_0 on 2017-09-01)

I have built and deployed dozens of Craft sites, so I know how to remove 'index.php' from urls, but now I have a site that refuses to accept my most determined efforts to remove it.

This is the situation:

* I am using the Craft supplied .htaccess file with the same settings
  as all of my other sites.
* Just to be thorough, I added 'omitScriptNameInUrls' => 'true', to the config file
* double checked all of the general settings in the CP and all is as it should be

After trying a few things, I found that if I use {{ siteUrl }}*path* I get a clean url, but if I use {{ url('path') }} it leaves that nasty index.php in the url. The same is true for {{ entry.url }}. One last bit of puzzlement - if I manually enter a full path, e.g. <http://sitename/news> it works fine

I suspect I am missing something obvious, but it is definitely driving me nuts!

**Tags:** url, siteurl


---

## 2 answers

### Answer by username_1 on 2017-09-02. Score: 4

This recently tripped me up. `'true'` (with quotes) is not the same as `true` (without the quotes).

Lose the quotes in the config file, clear Craft's caches, and it should stick.

Also make sure your `siteUrl` is the same as what your web server is configured as. If you have a redirect in there, say `www.example.com` goes to `example.com`, and your `siteUrl` is configured to use the former, that seems to trip up Craft's check too.

> **Comments:**
> **username_0**: Thanks, that was it! I knew it was something stupid on my part, guess I need to take more frequent breaks.  Much appreciated!  
> **username_1**: Mark it correct if you'd like. ;)  

---

### Answer by username_2 on 2017-09-01. Score: 1

Have you tried everything here? <https://craftcms.com/support/remove-index.php>

> **Comments:**
> **username_0**: Yes - as I said, doing this is nothing new for me  

---

