0

I created a virtualhost to a cakephp application:

I set the httpd-vhosts.conf this way:

<VirtualHost localhost:80>
   ServerAdmin localhost
    DocumentRoot /Applications/AMPPS/www/
    ServerName localhost
</VirtualHost>
<VirtualHost *:80>
        ServerName www.drin.com
        ServerAlias www.drin.com drin.com
        DocumentRoot /Applications/AMPPS/www/carte_drin/app/webroot

        Options -Indexes FollowSymLinks

    #disable htaccess starting at /
       <Directory />
                AllowOverride none
       </Directory>

       <Directory /Applications/AMPPS/www/carte_drin/app/webroot/>
                RewriteEngine On
                RewriteBase /
                RewriteCond %{REQUEST_FILENAME} !-d
                RewriteCond %{REQUEST_FILENAME} !-f
                RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

                <Files sitemap.xml>
                        RewriteEngine Off
                </Files>
        </Directory>
</VirtualHost>

And the /etc/hosts file this way also:

127.0.0.1   localhost
127.0.0.1 www.drin.com
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0 localhost

yet when I try to access to www.drin.com it points me to localhost page not to the application itself. I'm using AMPPS under MAC. If you know what's going wrong tell me.

Best

zakaria mouqcit
  • 393
  • 2
  • 4
  • 17
  • You've restarted Apache after updating the config, right? – Greg Schmidt Oct 22 '18 at 17:58
  • Try a ping of www.drin.com, does it resolve to 127.0.0.1? Depending how your system is configured, it might resolve to something else. – Nic3500 Oct 23 '18 at 01:08
  • I did restart the apache when I finished the config – zakaria mouqcit Oct 23 '18 at 08:14
  • The result of ping : PING www.drin.com (127.0.0.1): 56 data bytes. 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.060 ms and so on. – zakaria mouqcit Oct 23 '18 at 08:15
  • I need to create a virtualhost to get rid of the .htaccess files. I use them and the application works although the other projects under www don't because the .htaccess under www points to the current one I'm working on. – zakaria mouqcit Oct 23 '18 at 08:22

0 Answers0