简体   繁体   中英

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.

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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM