Page 1 of 1

Remove of appended directory in url

PostPosted: 09. February 2021 11:40
by BGK
Hi,

I have a site running on xampp 3.2.4 and Win2019 Server Standard.

On the server that xampp is running the url for the site is correct, so if its www.mydomain.com it displays www.mydomain.com in the address bar of the browser.

However, if I open the site from a desktop it appends the directory in which the site is in the htdocs directory. So if my site is under htdocs\mysite the "mysite" portion is appended to the domain. So instead of been "www.mydomain.com" its comes out as "www.mydomain.com/mysite/".

So what initially happened is that when i opened the site from outside the server the "/dashboard/" kept opening. I modified the index.php file and replaced the /dashboard/ with the directory of the site "/mysite/". So I guess its showing because of this change.
I have updated my "httpd-vhosts.conf" file with the domain and the correct directory of the site.

<VirtualHost *:80>
##ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "E:/xampp/htdocs/mysite"
ServerName listings.mydomain.com
ServerAlias listings.mydomain.com
##ErrorLog "logs/dummy-host.example.com-error.log"
##CustomLog "logs/dummy-host.example.com-access.log" common
<Directory "e:/xampp/htdocs/mysite">
Options All
AllowOverride All
Require all granted
</Directory>
</VirtualHost>


How or what do I need to change so that when opening the site outside of the server the url shows the domain name only and not the directory where the site is?

Thanks in advance.

Re: Remove of appended directory in url

PostPosted: 09. February 2021 22:33
by Nobbie
Unfortunately, your description is a mess. Its hard to understand, as you mix up domain names so and so. Horrible.

In your description, you are telliing about "www.mydomain.com". In your VirtualHost, there is no "www.mydomain.com", instead there is a "listings.mydomain.com".

And finally, i think, none of these domains are the real ones. What makes it even more confusing. Its definately totally impossible to give any hint, as we do not know, what REALLY happens.