Lokendra Parihar
Lokendra Parihar

Reputation: 131

Access two directories using httpd.conf on same domain

How can I configure httpd.conf to access laravelapp and phpmyadmin in below way:

http://something.com

Wants to access laravel app,

http://something.com/phpmyadmin 

to access phpmyadmin.

Directories laravelapp and phpmyadmin in /var/www/html

I did below code in /etc/httpd/conf/httpd.conf file, but not working.

  DocumentRoot "/var/www/html/laravelapp/public"

   #
   # Relax access to content within /var/www.
   #
   <Directory "/var/www/html/laravelapp">
       AllowOverride All
       # Allow open access:
       Require all granted
    </Directory>

<Directory "/var/www/html/phpmyadmin">
    AllowOverride All
    # Allow open access:
    Require all granted
</Directory>

Laravel app /public dir contains default .htaccess file as comes with laravel.

Upvotes: 0

Views: 299

Answers (1)

msg
msg

Reputation: 8181

Your phpadmin installation is outside the DocumentRoot so you need something else. You can either:

  • Create a symlink to the PMA installation (you'll need Options +FollowSymlinks for this which you should have, since All is the default).

  • Use mod_alias. You just need to add the following to your current config:

    Alias "phpmyadmin" "/var/www/html/phpmyadmin"

Upvotes: 1

Related Questions