dongpao5261 2016-11-20 23:05
浏览 35
已采纳

Apache + PHPMyAdmin - 将目录重定向到子域

So im running Apache on Ubuntu 16. I have phpmyadmin accessible via a directory because thats how it does it by default (e.g. to access phpmyadmin, I have to go to www.mydomain.com/phpmyadmin)

I wrote an Apache VHost to make it accessible via a subdomain as shown here in my Vhosts: http://pastebin.com/raw/tyZGbsSC

This works and now I can access phpmyadmin via a subdomain (phpmyadmin.mydomain.com) but the problem is that it is still accessible through the directory (www.mydomain.com/phpmyadmin)

How to i stop this?

  • 写回答

2条回答 默认 最新

  • doubai9014 2016-11-21 00:38
    关注

    There should be a conf file phpmyadmin.conf in /etc/apache2/conf-enabled which contains the following line

    Alias /phpmyadmin /usr/share/phpmyadmin
    

    Just comment out that line by putting a hash

    #Alias /phpmyadmin /usr/share/phpmyadmin
    

    and restart apache.

    That should do the job.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 CCF-CSP 2023 第三题 解压缩(50%)
  • ¥100 网页游戏在本地页面修改游戏结果
  • ¥30 comfyui openpose报错
  • ¥20 Wpf Datarid单元格闪烁效果的实现
  • ¥15 图像分割、图像边缘提取
  • ¥15 sqlserver执行存储过程报错
  • ¥100 nuxt、uniapp、ruoyi-vue 相关发布问题
  • ¥15 浮窗和全屏应用同时存在,全屏应用输入法无法弹出
  • ¥100 matlab2009 32位一直初始化
  • ¥15 Expected type 'str | PathLike[str]…… bytes' instead