<p>I had the same issue on my mac and struggled for hours.</p>

<p>Having the right .htaccess file in place was key, but if you are not getting Craft's error messages, that's a sign your .htaccess file is not having any effect (you can verify this by placing some random text in there and see if you get an internal server error or not).</p>

<p>Making the following changes to httpd.conf made .htaccess work and solved this issue for me: </p>

<ul>
<li>Change from "AllowOverride None" to AllowOverride All" in the
document root directory block</li>
<li>Uncomment LoadModule rewrite_module...</li>
</ul>

<p>I hope this helps someone solve this quicker than I did.</p>

CC BY-SA 4.0
2019-07-11T09:23:23.270Z
2019-07-11T09:23:23.270Z
Topolino
<p>As Brad Bell pointed out in a comment that you should use index.php, it might have something to do with your .htaccess and general.php</p>

<p>Your .htaccess File should look something similair to this:</p>

<pre><code>&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On
    RewriteBase /

    # Send would-be 404 requests to Craft
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
    RewriteRule (.+) index.php?p=$1 [QSA,L]
&lt;/IfModule&gt;
</code></pre>

<p>This doens't do the trick yet though.
In your <code>craft/config/general.php</code> you have to add:
<code>'omitScriptNameInUrls' =&gt; true,</code> Now you should be able to access your admin panel with: ronvanderwerf.loc/admin/ </p>

<p>You can find a more indept explanation in the docs here:</p>

<p><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-03-21T12:59:27.740Z
2017-03-21T12:59:27.740Z
Justin Dekkers
<p>Try instead</p>

<pre><code>$craftPath = 'craft';
</code></pre>

CC BY-SA 3.0
2017-02-21T00:30:19.437Z
Can you show the contents of db.php?
Cem Meric
CC BY-SA 3.0
2017-02-21T18:38:01.283Z
I prefer to keep the details private. But this is how it looks like:
`<?php

return array(
        'server' => ''127.0.0.1",
        'user' => 'user',
        'password' => 'password',
        'database' => 'ronvanderwerf'
);`
Mr. Sam
CC BY-SA 3.0
2017-02-22T20:32:51.073Z
If ronvanderwerf.loc/index.php?p=admin is taking you to new installation page and you had already setup the site before making those changes to move from localhost to ronvanderwerf.loc, I'd say something changed with db server in Wamp. Try playing with 'server' => ''127.0.0.1" setting in db.php
Cem Meric
CC BY-SA 3.0
2017-02-25T20:23:24.073Z
I'm trying to setup the site. ronvanderwerf.loc/admin should bring me to the installation of craft. Instead of that, I get a 404 not found.
I did try using "127.0.0.1" but that didn't made any difference.
I think I've made a mistake defining the paths (for the admin). But I don't know where, or how to fix this.
Mr. Sam
CC BY-SA 3.0
2017-02-19T22:05:25.680Z
Unfortunately that didn't help
Mr. Sam
CC BY-SA 3.0
2017-02-19T11:51:41.323Z
2017-02-19T11:51:41.323Z
Cem Meric
<p>It's the first time I'm using Wamp for local hosting my Craft website.
I've changed my Windows and Wamp apache host file for accessing my domainname instead of localhost. (<em>ronvanderwerf.loc</em> instead of <em>localhost</em>)</p>

<p>The front-end of the website looks fine:</p>

<p><a href="https://i.sstatic.net/Ft2I1.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Ft2I1.png" alt="enter image description here"></a>
(I'm getting a error because I still need to setup Craft)</p>

<p>The problem is, I can't access the admin panel. I get a 404 Not Found.</p>

<p>I've changed the directory order of my project for some hosting reasons:</p>

<p><a href="https://i.sstatic.net/Gy5zX.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Gy5zX.png" alt="enter image description here"></a></p>

<p><strong>My apache host file:</strong></p>

<pre><code>&lt;VirtualHost *:80&gt;
ServerName ronvanderwerf.loc
DocumentRoot c:/wamp64/www
&lt;Directory  "c:/wamp64/www/"&gt;
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
&lt;/Directory&gt;
</code></pre>

<p></p>

<p><strong>My root htaccess file:</strong></p>

<pre><code>&lt;IfModule mod_rewrite.c&gt;
RewriteBase /

# Send would-be 404 requests to Craft
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
RewriteRule (.+) index.php?p=$1 [QSA,L]
</code></pre>

<p></p>

<p>I hope someone can help me.</p>

CC BY-SA 3.0
2017-02-21T18:33:08.983Z
@BradBell I can access `ronvanderwerf.loc/index.php?p=admin`
Mr. Sam
CC BY-SA 3.0
2017-02-21T18:41:28.807Z
@ClivePortman I tried it, but unfortunately it didn't made any difference
Mr. Sam
CC BY-SA 3.0
2017-02-21T19:07:44.073Z
If you can access ronvanderwerf.loc/index.php?p=admin, did it bring you to the installation page?  Or what did you see?
Brad Bell
CC BY-SA 3.0
2017-02-21T19:31:55.397Z
@BradBell It brings me to the installation page ;)
Mr. Sam
CC BY-SA 3.0
2017-03-07T21:39:29.403Z
@BradBell What should I do?
Mr. Sam
CC BY-SA 3.0
2017-03-07T21:49:17.053Z
Not sure what the issue is now?  If you can get to the installation page, then just go through the installation process?
Brad Bell
CC BY-SA 3.0
2017-03-08T21:14:35.857Z
@BradBell I was looking for a solution so I can access the admin through `ronvanderwerf.loc/admin` instead of `ronvanderwerf.loc/index.php?p=admin`.

I've achieved this by using a redirect in htaccess, but I was wondering if there is a other solution.
Mr. Sam
CC BY-SA 3.0
2017-02-20T00:22:22.887Z
What if you access `ronvanderwerf.loc/index.php?p=admin`?
Brad Bell
CC BY-SA 3.0
2017-02-20T10:20:21.840Z
Can you try this: http://stackoverflow.com/questions/7670561/how-to-get-htaccess-to-work-on-mamp
Clive Portman
<control-panel><admin><404><apache><hosting>
Can't access admin panel
# Can't access admin panel

(Asked by: username_0 on 2017-02-19)

It's the first time I'm using Wamp for local hosting my Craft website.
I've changed my Windows and Wamp apache host file for accessing my domainname instead of localhost. (ronvanderwerf.loc instead of localhost)
The front-end of the website looks fine:

(I'm getting a error because I still need to setup Craft)
The problem is, I can't access the admin panel. I get a 404 Not Found.
I've changed the directory order of my project for some hosting reasons:

My apache host file:

ServerName ronvanderwerf.loc
DocumentRoot c:/wamp64/www

    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local



My root htaccess file:

RewriteBase /

# Send would-be 404 requests to Craft
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
RewriteRule (.+) index.php?p=$1 [QSA,L]


I hope someone can help me.

**Tags:** control-panel, admin, 404, apache, hosting

> **Comments:**
> **username_1**: What if you access `ronvanderwerf.loc/index.php?p=admin`?  
> **username_2**: Can you try this: http://stackoverflow.com/questions/7670561/how-to-get-htaccess-to-work-on-mamp  
> **username_0**: @BradBell I can access `ronvanderwerf.loc/index.php?p=admin`  
> **username_0**: @ClivePortman I tried it, but unfortunately it didn't made any difference  
> **username_1**: If you can access ronvanderwerf.loc/index.php?p=admin, did it bring you to the installation page?  Or what did you see?  
> **username_0**: @BradBell It brings me to the installation page ;)  
> **username_0**: @BradBell What should I do?  
> **username_1**: Not sure what the issue is now?  If you can get to the installation page, then just go through the installation process?  
> **username_0**: @BradBell I was looking for a solution so I can access the admin through `ronvanderwerf.loc/admin` instead of `ronvanderwerf.loc/index.php?p=admin`.  I've achieved this by using a redirect in htaccess, but I was wondering if there is a other solution.  

---

## 3 answers

### Answer by username_3 on 2019-07-11. Score: 3

I had the same issue on my mac and struggled for hours.

Having the right .htaccess file in place was key, but if you are not getting Craft's error messages, that's a sign your .htaccess file is not having any effect (you can verify this by placing some random text in there and see if you get an internal server error or not).

Making the following changes to httpd.conf made .htaccess work and solved this issue for me:

* Change from "AllowOverride None" to AllowOverride All" in the
  document root directory block
* Uncomment LoadModule rewrite\_module...

I hope this helps someone solve this quicker than I did.


---

### Answer by username_4 on 2017-03-21. Score: 2

As username_1 pointed out in a comment that you should use index.php, it might have something to do with your .htaccess and general.php
Your .htaccess File should look something similair to this:

    RewriteEngine On
    RewriteBase /

    # Send would-be 404 requests to Craft
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
    RewriteRule (.+) index.php?p=$1 [QSA,L]


This doens't do the trick yet though.
In your craft/config/general.php you have to add:
'omitScriptNameInUrls' => true, Now you should be able to access your admin panel with: ronvanderwerf.loc/admin/ 
You can find a more indept explanation in the docs here:
https://craftcms.com/support/remove-index.php


---

### Answer by username_5 on 2017-02-19. Score: 0

Try instead
$craftPath = 'craft';

> **Comments:**
> **username_0**: Unfortunately that didn't help  
> **username_5**: Can you show the contents of db.php?  
> **username_0**: I prefer to keep the details private. But this is how it looks like: `<?php  return array(         'server' => ''127.0.0.1",         'user' => 'user',         'password' => 'password',         'database' => 'ronvanderwerf' );`  
> **username_5**: If ronvanderwerf.loc/index.php?p=admin is taking you to new installation page and you had already setup the site before making those changes to move from localhost to ronvanderwerf.loc, I'd say something changed with db server in Wamp. Try playing with 'server' => ''127.0.0.1" setting in db.php  
> **username_0**: I'm trying to setup the site. ronvanderwerf.loc/admin should bring me to the installation of craft. Instead of that, I get a 404 not found. I did try using "127.0.0.1" but that didn't made any difference. I think I've made a mistake defining the paths (for the admin). But I don't know where, or how to fix this.  

---

