In Apache, every time you access a directory and do not use "/" in the end of path, the web server will rebuild the path and convert it from "http://www.domain.name/directory" into "http://www.domain.name/directory/".
When Apache rebuilds the path, it does it using the ServerName parameter specified in "httpd.conf" file. By default, the ServerName for your Linux virtual server is its IP address.
There is no way to prevent Apache from rebuilding the path, however there are ways to make the final path look differently:
- You can change the ServerName set for your account in httpd.conf. To do this, please access the HostPilot control panel and navigate to 'Web/FTP Server > Apache Server > Server Settings'. Here you can find the 'Server Name' setting and set its value to the IP address of your virtual server as well as to any domain name that is registered on your account. Please note that only one of your domains can be selected. It means that every time Apache rebuilds the path, it will use the selected domain name even if you originally requested one of the other domains.
- Change ALL links on your site to include a slash at the end of every directory. So that all absolute links refer to "http://www.domain.name/directory/" and all relative links refer to "directory/" or "/directory/".
- If you are using PHP, you can change the header location in your default script for each directory. For example:
$HTTP_HOST = getenv('HTTP_HOST');
if ($HTTP_HOST != 'www.domain.name')