Jump to content

Can I set a folder to act like a root domain in PHP/Apache?


wilsonf1

Recommended Posts

Currently I am developing my website like this:http://localhost:8888/mysite/Because of my multi level folders, I point many of my links like so href="/index.html" - the forward slash is to get me to to root of my domain.This works perfectly on my live server, but on my machine it obviously makes my links point to localhost:8888/index.htmlSo is there a way I can hit in my browser, something like: http://mysite/, but it's actually loading the content of: http://localhost:8888/mysite/I am using WAMP on a Windows 7 machine :)

Link to comment
Share on other sites

Note that if you actually want http://mysite/ to load http://localhost/mysite/, along with creating a virtual host for mysite you will also need to modify your hosts file (or otherwise alter the DNS) to point mysite to 127.0.0.1. Unfortunately you can't change the port, and will have to request http://mysite:8888/ (or change the server at localhost to listen on port 80).

Link to comment
Share on other sites

  • 2 months later...
Note that if you actually want http://mysite/ to load http://localhost/mysite/, along with creating a virtual host for mysite you will also need to modify your hosts file (or otherwise alter the DNS) to point mysite to 127.0.0.1. Unfortunately you can't change the port, and will have to request http://mysite:8888/ (or change the server at localhost to listen on port 80).
slightly delayed but trying to implement this tonight!so say my website is mysite.comand in wamp i have /www/mysiteif i want to hit mysiteLOCAL.ccom on my machine and see the local copy, how do I implement it? So far I've tried this in HTTP.confNameVirtualHost *:8888<VirtualHost *:8888>DocumentRoot /www/mysite/ServerName mysiteLOCAL:8888And this is my hosts file:127.0.0.1:8888 mysiteLOCAL.comBut it didn't work - Am i close? 8888 is my apache port seeing as 80 is used by iischeers!
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...