2

I want to create virtual host and sub-domains for that host on local machine such that my localhost serve as a website like I do not need to write localhost in url bar:

localhost  ---> mysite.com
           ---> sd1.mysite.com
           ---> sd2.mysite.com

actually I am using wordpress plugin WP Subdomains which makes sub-domain for main categories like.

cat1.localhost
cat2.localhost

but if we try to access cat1.localhost browser error Server not found which is definitely because we did not create sub-domain named cat1 for localhost.

I google but no solution found which exactly solve my problem.

I also followed http://www.talkphp.com/general/2170-setup-sub-domain-wamp.html

but following error appear:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

PHP Ferrari
  • 15,754
  • 27
  • 83
  • 149

2 Answers2

2

Okay got it....

I followed http://www.talkphp.com/general/2170-setup-sub-domain-wamp.html but skip step 3:

Open up: C:\wamp\bin\apache\apache2.2.6\conf\extra\httpd-vhosts.conf.

and in httpd.conf comment DocumentRoot "E:/wamp/www/" and add

DocumentRoot "E:/wamp/www/wordpress"

and it work. :)

PHP Ferrari
  • 15,754
  • 27
  • 83
  • 149
  • 1
    Not only is it broken, but the archive.org cache of the page points to another link that is broken, which isn't on archive.org D: But users will probably want this answer: http://stackoverflow.com/a/16878503 and this answer: http://stackoverflow.com/a/16878503 – iautomation Jul 10 '16 at 06:07
1

Please follow the link below. I tried this and working fine for me.

http://www.axertion.com/tutorials/2012/03/how-to-setup-local-subdomains-using-wampserver/

Shakeel Ahmed
  • 1,526
  • 17
  • 22