1

I'm trying to setup a virtual host to access my craft project through ontherocks.dev, without any success yet.

  • www.ontherocks.dev : correct response
  • www.ontherocks.dev/admin : Apache 404
  • www.ontherocks.dev/index.php/admin : redirected to www.ontherocks.dev/admin/install with an Apache 404

I didnt "install" craft yet, which explains the redirect. Here are my config files for the virtual host :

httpd-vhosts.conf

<VirtualHost *:80>
  ServerName ontherocks.dev
  DocumentRoot "C:\wamp\www\y-lynx"
  ServerAlias www.ontherocks.dev
 DirectoryIndex index.php
</VirtualHost>

hosts file in system32/drivers/etc

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost
127.0.0.1       ontherocks.dev

Thanks for your help !

1
  • Try setting ServerAlias to ontherocks.dev (minus the www) and access the site using ontherocks.dev.
    – Brad Bell
    Commented May 25, 2015 at 17:03

1 Answer 1

2

Looks like the .htaccess file included with Craft is not being read or you didn't rename it (should be .htaccess with the period at the beginning).

That's why /index.php/admin is working but /admin/ is not.

One other possibility is Apache is setup to ignore .htaccess files. If that's the case, add this to your httpd-vhosts.conf file.

<Directory "C:\wamp\www\y-lynx">
    AllowOverride All
</Directory>

(If you already have a <Directory "C:\wamp\www\y-lynx"> block, just add in AllowOverride All somewhere inside.)

1
  • Thanks mate, that was part of the problem :). The real one was that I'm dumb and forgot to check if mod_rewrite was on, which wasn't. Anyway thanks !
    – ovesco
    Commented May 26, 2015 at 7:18

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.