Where RVH is your virtual host name (I use a lot of initials for mine) and the website files are located at C;\RVH. Obviously, change the name and location to suit your own preferences.
Edit your hosts file (it’s extensionless and located at C:\Windows\System32\drivers\etc\hosts) AS ADMINISTRATOR and add the one-liner:
127.0.0.1 RVH
If you had not RUN AS ADMINISTRATOR, you will NOT be able to save this file!
Restart Apache.
You will then be able to access your new virtual host using http://RVH.
Okay, you wanted to change your virtual host to a subdirectory within your canned app (WAMP) but why not do it right? Using virtual hosts will make your life so much easier.
Open hosts again and you will see that you have NOT made the necessary change BECAUSE Notepad will NOT let you save a file without the txt extension. I use EditPad Lite but you should be able to use notepad++ or any other GOOD text editor (Notepad does not qualify in this category).
IMHO, Notepad is good for use as a, errm, note pad, but not as a code editor.
Similarly, Word might be great at creating print documents, but please, don’t use it for working with code (or risk learning the hard way)
I currently use Notepad++ on my Windows7 and like it for “outside of an IDE” work.
GREAT! Assuming that you ran Notepad++ AS ADMINISTRATOR, simply save the hosts file and restart Apache then access your virtual host via http://ronisvanhelms/.
Edit: I have ASS-u-me’d that WAMP did not install in a Program Files directory or you would have to have run Notepad++ AS ADMINISTRATOR in order to save the httpd-vhosts.conf file, too.
LOL
You know the saying about that word don’t you?
And remember, this is Windows.
As best as I can figure, the “as Admin” is needed for files that don’t follow the filename.extension format.
Have you named a DirectoryIndex in your .htaccess file? If not, you can’t use / as the last character in the URI so you’d better add the file name (and extension) that you want to view.
That is the “official” way to change the DirectoryIndex (default script) which will look through the list and serve the first file found.
Note: This should already be in your httpd.conf file but, if not, add it there, add it in your httpd-vhosts.conf or add it in your ronisvanhelms .htaccess file.
WHY would you insist on looking through the localhost directory for a virtual host which can be stored elsewhere (and has NOTHING to do with localhost as a URL)? For that matter, WHY would you use the -new at the end of your virtual host when you did not create it with -new?
IF you were able to save the hosts and httpd-vhosts.conf files and IF you restarted Apache after that, access your new virtual host using http://ronisvanhelms/ and let the DirectoryIndex serve the appropriate file from the C:/wamp/www/ronisvanhelms-new directory. THAT is what virtual hosts can do for you if you let them!
hosts is correctly configured for ronisvanhelms-new as a locally hosted virtual domain.
httpd-vhosts.conf is properly configured to add ronisvanhelms-new as a virtual domain.
The WAMP server is improperly configured (I don’t know how/why because I will not use “canned apps” for a snapshot view of a server. There is NOTHING which should allow that configuration page to be displayed.
ronisvanhelms-new/ronisvanhelms-new should not exist (or the virtual domain should be to that directory rather than the first level - WHY did you do that?).
You’ve created a WordPress website in the second level directory.
I do NOT see the .htaccess file in the DocumentRoot (currently the first level) which specifies that the index.php (or any other in the DirectoryIndex list) file should be served. In the second level, WordPress would have specified a redirection to index.php so that does not need a DirectoryIndex directive (albeit, it should already be in the httpd.conf).
Please correct the confusion caused by the double directories.then show your .htaccess file(s). With this strange setup, we need to see more to make sense of what you’ve done. Okay, okay, maybe it’s just me that’s dense and I need that “handholding.”
oj, I understand that I set up the hosts file and the httpd-vhosts.conf file correctly (that was verifiable cause http://ronisvanhelms-new/ works)
You say the WAMP server is not configured properly?
Should I ask http://forum.wampserver.com/ how to configure it for my needs?
ronisvanhelms-new/ronisvanhelms-new did look strange to me, but I thought that was because I set
127.0.0.1 localhost
127.0.0.1 ronisvanhelms-new
(is it ok thats it point to the same # as localhosts?)
How do I set the virtual directory to the ronisvanhelms-new directory rather than the 1st level?
(the 1st level is the WAMPSERVER Homepage right?)
Heres my .htaccess file (on the right, you can see how the site is set up (as far as the directory structure)
Correct. You should never see any configuration file via Apache. Perhaps that’s a “feature” of WAMP, though.
It is not only okay but MANDATORY that you use 127.0.0.1 for your virtual hosts located at localhost (your computer). hosts will sort out the different virtual hosts for you.
You have already set the virtual host DocumentRoot to ronisvanhelms-new. Therefore, merely connect to it via http://ronisvanhelms-new. The simple fact that you then see http://ronisvanhelms-new/ronisvanhelms-new indicates a problem - likely that EITHER your virtual host is pointed to localhost as the DocumentRoot (it’s not from what I’ve seen of your files) OR WordPress is not setup to use the ronisvanhelms-new directory as the DocumentRoot. Translated: Check your WordPress configuration.
Okay, from the microscopic text of your image, your mod_rewrite (WordPress configuration) is all wrong. WordPress should be installed in the ronisvanhelms-new directory (making the RewriteBase redundant - DELETE) and the RewriteRule should ot be redirecting to the ronisvanhelms-new subdirectory (of ronisvanhelms-new, the domain). It might help you if DW is conrrectly configured (test server) to point to the ronisvanhelms-new directory, too.
Please Google Virtual Host for a better picture of what I’ve been saying for the last dozen posts. It is a domain located on your server and it’s just that simple! BTW,
I’ve NEVER seen any webmaster use a wordpress directory for a website which is run by WP! Perhaps a visit to WP’s forum may help you resolve that issue (I’d move all the files from the wordpress subdirectory to the DocumentRoot but that’s your choice).
WARNING: If you’re going to run a (production, i.e., live to the world) WP website, you MUST plan on checking for updates AT LEAST DAILY because WP is hacked regularly. If you don’t, plan on rebuilding your website regularly after being hacked by the script kiddies that download exploits from hacker websites. IMHO, it’s not worth running a WP website because of all the additional work trying to catch up with the hacker community (and you’ll NEVER get ahead of them).
Adding a new project or Version_002 requires creating a new directory with another index-LOCALHOST.php and .htaccess-LOCALHOST files. The _menu system automatically includes the new path.