问题
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