Thursday, February 2, 2012

Removing localhost in local


Steps to remove  http://localhost    from url in  local development environment.

1. In Xampp
- open file: xampp/apache/conf/extra/httpd-vhosts.conf

change the following according to need.

NameVirtualHost *:80


ServerName localhost
DocumentRoot E:/xampp/htdocs/


DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all



ServerName local.anitshrestha.com.np
DocumentRoot E:/xampp/htdocs/local.anitshrestha.com.np


DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all




2. In windows
- open file windows/system32/drivers/etc/hosts

change the following according to need.

127.0.0.1    localhost
127.0.0.1    local.anitshrestha.com.np


Notes:
1. local.anitshrestha.com.np
the site is anishrestha.com.np. adding local is the convention to denote this is on the local environment not live, thats my convention yours can be different.

if you find out more let me know aswell.