<p>Check and make sure your .htaccess file is in your public HTML folder <code>public/.htaccess</code>!</p>

<p>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 <code>index.php?p=</code> in your URL.</p>

<p>Without <code>.htaccess</code>:<br>
<a href="http://website.com/mypagethatreallyexists" rel="nofollow">http://website.com/mypagethatreallyexists</a> = 404</p>

<p>Without <code>.htaccess</code>:<br>
<a href="http://website.com/index.php?p=mypagethatreallyexists" rel="nofollow">http://website.com/index.php?p=mypagethatreallyexists</a> = Your page</p>

<p>With <code>.htaccess</code>:<br>
<a href="http://website.com/mypagethatreallyexists" rel="nofollow">http://website.com/mypagethatreallyexists</a> = Your page</p>

CC BY-SA 3.0
2015-02-18T06:23:38.143Z
2015-02-18T06:23:38.143Z
Ben Parizek
<p>Try setting <a href="http://buildwithcraft.com/docs/config-settings#omitScriptNameInUrls" rel="nofollow"><code>omitScriptNameInUrls</code></a> to true in your <code>craft/config/general.php</code> file.</p>

CC BY-SA 3.0
2014-09-29T21:02:26.053Z
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
CC BY-SA 3.0
2014-09-29T18:52:58.977Z
2014-09-30T16:16:51.180Z
2014-09-30T16:16:51.180Z
Brad Bell
<p>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?</p>

CC BY-SA 3.0
2014-09-29T21:03:26.410Z
Can you post the contents of your `.htaccess` file in your public HTML folder?
Brad Bell
CC BY-SA 3.0
2014-09-29T21:06:28.657Z
Which highlights my rookie error, wrong .htaccess file! Cheers Brad!
David Martin
CC BY-SA 3.0
2014-09-29T21:19:08.780Z
Hah... happens to the best of us.  Can you post that as an official answer?
Brad Bell
<url><config><routing><404-page>
Can't remove index.php without getting a 404, .htaccess redirect not working, why?
# Can't remove index.php without getting a 404, .htaccess redirect not working, why?

(Asked by: username_0 on 2014-09-29)

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?

**Tags:** url, config, routing, 404-page
> **Comments:**
> **username_1**: Can you post the contents of your `.htaccess` file in your public HTML folder?  
> **username_0**: Which highlights my rookie error, wrong .htaccess file! Cheers Brad!  
> **username_1**: Hah... happens to the best of us.  Can you post that as an official answer?  

---

## 2 answers

### Answer by username_2 on 2015-02-18. Score: 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


---

### Answer by username_1 on 2014-09-29. Score: 1

Try setting [`omitScriptNameInUrls`](http://buildwithcraft.com/docs/config-settings#omitScriptNameInUrls) to true in your `craft/config/general.php` file.

> **Comments:**
> **username_0**: 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?  

---

