Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to replace localhost by project name from URL

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1
    • 0
    • 295
    Comment on it

    Hello Reader's if you are working on single project and want to rename localhost to any other word then this blog is very helful to you. 

    So let's start with the following steps

    Step 1 : Open httpd.conf file you can fine it in the path( C:\wamp\bin\apache\Apache2.2.17\conf\ 
    open httpd.conf file and change )

    Now remove the # and uncomment the line below:-
    #Include conf/extra/httpd-vhosts.conf to 
    Include conf/extra/httpd-vhosts.conf 
    By doing this virtual host will  know you have mention some other host which is now using.

    Step 2  Open httpd-vhosts.conf you can find it in the path here

    C:\wamp\bin\apache\Apache2.2.17\conf\extra 
    Now paste the following code in it.

    <VirtualHost myWebsite.local>
        DocumentRoot "C:/wamp/www/tajerlee/"
        ServerName tajerlee.local
        ServerAlias tajerlee.local
        <Directory "C:/wamp/www/tajerlee/">
            Order allow,deny
            Allow from all
        </Directory>
    </VirtualHost>
    

    change myWebsite.local and C:/wamp/www/abc/ as per your requirements. 
    you can put the url which you want to hit in url

    Step 3:- Now Open hosts file in C:/Windows/System32/drivers/etc/ and add the following line ( Just be careful not to delete any code in it) 

    127.0.0.1 myWebsite.local
    

    change myWebsite.local as per your name requirements

    Step 4:- Restart your server. That's it

    You can see it in the screenshot as below I'm actualy hitting the localhost but the url looks like I'm working on live site.

     

    How to replace localhost by project name from URL

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: