Solved

Preview Site

Posted on 2014-02-10
1
217 Views
Last Modified: 2014-02-26
Ive been used to always editing the hosts file and adding the website Im working on to the Apache conf file as a vhost, but its a right pain when working on multiple PCs. On my webhost site I can preview a site before it goes live, and Im wondering how you do that.

I can see on certain sites that phpMyAdmin is put in as a alias:-
Alias /phpmyadmin "c:/htdocs/phpmyadmin/"

<Directory "c:/htdocs/phpmyadmin/">
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

Open in new window


However when I try and add my site into it, such as:-
Alias /mySite1 "c:/htdocs/mySite1/"

<Directory "c:/htdocs/mySite1/">
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

Open in new window


And navigate to http://localhost/mySite1 It has issues pulling in scripts and images, however works fine accessing it from http://mySite1 after I set it up as a vhost:-
<VirtualHost *:80>
	DocumentRoot c:/htdocs/mySite1/
	ServerName mySite1
</VirtualHost>

Open in new window


And edit my hosts file to:-
127.0.0.1     mySite1

Open in new window


I had thought about using a portable DNS server which I could just run, and on the development machine just point the primary DNS to 127.0.0.1 but I cannot find a portable DNS server, only ones that install - do not understand why, maybe a project for me in the future, but not at the moment.

Any ideas how to preview a site from localhost instead of having to edit the hosts file continuously?

Thank you
0
Comment
Question by:tonelm54
1 Comment
 
LVL 26

Accepted Solution

by:
arober11 earned 500 total points
ID: 39849882
Guessing your markup has absolute paths in it e.g.

="/image/xxxx.jpg"
="/js/xxxxx.js"

If you go through the HTML and remove the leading slashes, to make the paths relative, pic's and scripts may start to appear.
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you have a multi-homed DNS setup in windows, you can have issues with connectivity to the server that hosts the DNS services (or even member servers of your domain if this same DNS server is a DC). This is because windows registers all of its IPs…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question