How to change the default “www directory” for wampserver

青春壹個敷衍的年華 提交于 2019-12-21 19:56:36

问题


All my websites are located in D:/Documents/websites directory. I already managed to point http://localhost/ to that folder based on this video tutorial.

But what I also want is whenever I click on "www directory" from the wampserver panel it opens up D:/Documents/websites directory instead of C:/wamp/www which is the default one.

How do I achieve that? Thank you.


回答1:


First make a backup of \wamp\wampmanager.tpl as mistakes in here can make wampmanager unstartable.

Now edit \wamp\wampmanager.tpl using a decent editor and not notepad

Find this line, its line 138 approx.

Type: item; Caption: "${w_wwwDirectory}"; Action: shellexecute; FileName: "${wwwDir}"; Glyph: 2

Copy/Paste that line below itself and then change it to be something like this

Type: item; Caption: "My Sites"; Action: shellexecute; FileName: "d:/Documents/Websites"; Glyph: 2

Save the file.

Now either start WAMPServer or if it was actually already running refresh the menus by doing :-

rightclick on wampmanager icon -> refresh

You should now see your new menu.

If you want you could now go back and delete the original line that creates the www directory menu item.



来源:https://stackoverflow.com/questions/28477298/how-to-change-the-default-www-directory-for-wampserver

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!