1

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:

enter image description here (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:

enter image description here

My apache host file:

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

My root htaccess file:

<IfModule mod_rewrite.c>
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.

  • What if you access ronvanderwerf.loc/index.php?p=admin? – Brad Bell Feb 20 '17 at 0:22
  • Can you try this: stackoverflow.com/questions/7670561/… – Clive Portman Feb 20 '17 at 10:20
  • @BradBell I can access ronvanderwerf.loc/index.php?p=admin – Mr. Sam Feb 21 '17 at 18:33
  • @ClivePortman I tried it, but unfortunately it didn't made any difference – Mr. Sam Feb 21 '17 at 18:41
  • 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 Feb 21 '17 at 19:07
1

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

Your .htaccess File should look something similair to this:

<IfModule mod_rewrite.c>
    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]
</IfModule>

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

1

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.

0

Try instead

$craftPath = 'craft';
  • Unfortunately that didn't help – Mr. Sam Feb 19 '17 at 22:05
  • Can you show the contents of db.php? – Cem Meric Feb 21 '17 at 0:30
  • 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 Feb 21 '17 at 18:38
  • 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 Feb 22 '17 at 20:32
  • 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 Feb 25 '17 at 20:23

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.