PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, January 12, 2022

[FIXED] Use Wamp without having to use projects

 January 12, 2022     lamp, mamp, wamp     No comments   

Issue

So, I love Wamp. It's great for development. The only downside is that in wamp, I have to code everything to use "localhost/projectname/" as a base, but on my actual site, everything has the base of just "/".

Is there a way to use wamp where it treats localhost has your website url?


Solution

here's how I'm doing :

  1. I'm editing my httpd.conf file and append a virtual host at the bottom of it (in the dedicated lines) each time I want to add a new local website :

    <VirtualHost *:80>
        DocumentRoot "C:/wamp/www/fake"
        ServerName fakesite
    </VirtualHost>
    
  2. And I tell windows to point the local host address (127.0.0.1) from the hostname that I defined (fakesite in the example):

I'm using windows and I just edit the following file : X:\Windows\System32\drivers\etc\hosts and append a new line as follow : 127.0.0.1 fakesite

note : you'll need to restart wamp after edition config files.

This way and if everything went right you'll just need to type fakesite/xxx to reach the following physical folder : c:/wamp/www/fake/xxx



Answered By - vdegenne
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing