2016-05-10 10 views
0

私のウェブサイトのアドレスをhttp://localhost/tests/home.html からwww.mywebsite.comに変更したいと思います。Wampローカルホスト編集WAMPSERVERホームページへ

説明したように、私は、次のファイルを編集した:

C:\wamp\bin\apache\Apache2.2.17\conf\httpd.conf 
C:\wamp\bin\apache\Apache2.2.17\conf\extra\httpd-vhosts.conf 
C:\Windows\System32\drivers\etc\hosts 

はしかし、私はhome.htmlになく、WAMPをサーバーのホームページにリダイレクトされていませんよ。 これを解決する方法はありますか?情報については、私のhttpd-vhosts.confhostsファイルです。

<VirtualHost *:80> 
ServerName www.mywebsite.com 
DocumentRoot c:/wamp64/www/tests 
<Directory "c:/wamp64/www/tests/"> 
    Options Indexes FollowSymLinks MultiViews 
    AllowOverride All 
    Require local 
</Directory> 
また

127.0.0.1 localhost 
127.0.0.1 tests 
127.0.0.1 www.mywebsite.com 

::1 localhost 
::1 tests 
::1 www.mywebsite.com 

、そこに私の www/testsフォルダ内の複数のファイルがありますが、私は特にhome.htmlしアクセスすることに注意してください。

答えて

0

はまた、あなたが仮想ホスト

<VirtualHost *:80> 
    ServerName localhost 
    DocumentRoot c:/wamp64/www 
    <Directory "c:/wamp64/www/"> 
     Options Indexes FollowSymLinks MultiViews 
     AllowOverride All 
     Require local 
    </Directory> 
</VirtualHost> 

を作成し、www.www.mywebsite.com

<VirtualHost *:80> 
    ServerName mywebsite.com 
    ServerAlias www.mywebsite.com 
    DocumentRoot c:/wamp64/www/tests 
    <Directory "c:/wamp64/www/tests/"> 
     Options Indexes FollowSymLinks MultiViews 
     AllowOverride All 
     Require local 
    </Directory> 
</VirtualHost> 

Hostsファイルを使用したい場合は、サーバー名がServerAliasmywebsite.comであるべきときVH定義FOTのローカルホストを必要とします変更

127.0.0.1 localhost 
127.0.0.1 tests 
127.0.0.1 mywebsite.com 

::1 localhost 
::1 tests 
::1 mywebsite.com 

一度thes eはchnagedされ、Dnscacheは

net stop dnscache 
net start dnscache 

そして、これらのchnages

wampmanager -> Apache -> Restart Service 
+0

おかげで多くのことをピックアップしてApacheを再起動にリセットすることを忘れないでください。メインページの名前を "index.php"にする必要があると付け加えますが、それを変更する方法が必要です。 –

+0

はい、それは変更できますが、Webサーバーにはかなり普遍的なものなので、変更を提案することはありません。 – RiggsFolly

関連する問題