Have a server on our network that r开发者_StackOverflow社区uns a webservice so when you go to URL it shows as http:\myserver
Can I use the hostfile of something similar to force the URL to display as http:\myserver.domain.com
??? Please help.
Create a DNS record that points the server's IP address to the name you want to use in the URL.
I think the following in your .htaccess should do the trick without creating a redirect loop:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^SERVER$ [NC]
RewriteRule .* http://SERVER.domain%{REQUEST_URI} [R=301,L]
It may need a bit if tweeking, but it's how I would do it.
精彩评论