Remove of appended directory in url
Posted: 09. February 2021 11:40
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.
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.