change Apache document root in XAMPP
You can get this work by setting apache virtual host at locally as describe below:
For example in ubuntu /etc/apache2/httpd.conf,
If you are using XAMPP on window that is the case, then the httpd.conf file should be C:\xampp\apache\conf\httpd.conf.
Please follow below steps to configure your local sites at local server:
------------
Step 1
------------
i.e
<VirtualHost *:80>
ServerName test.demo.tst ( Any name you want to set )
DocumentRoot "C:/xampp/htdocs/bf"
<Directory "C:/xampp/htdocs/bf">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
#RackEnv development
ErrorLog C:/xampp/htdocs/bf/logs/test.demo.tst_error
CustomLog C:/xampp/htdocs/bf/logs/test.demo.tst_access common
</VirtualHost>
------------
Step 2
------------
Than you need to restart apache service
------------
Step 3
------------
Than you need to do setting in your hosts files
for example in hosts file place below entry
127.0.0.1 test.demo.tst
------------
Step 4
------------
Than you can access this url test.demo.tst local server.
I hope this informations would be helpful to you.
how to configuring a xampp web server for different root directory
You can change Apaches httpd.conf by clicking (in xampp control panel) apache/conf/httpd.conf
and adjust the entries for DocumentRoot
and the corresponding Directory
entry.
Just Ctrl+F for "htdocs" and change the entries to your new path.
See screenshot:
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
Changing DocumentRoot on XAMPP on Windows 10 causes Error 403
As it turns out, I was trying to access the server on https. http://localhost worked just fine. To make it work on HTTPS, apart from the httpd.conf, I also had to edit the http-ssl.conf:
<VirtualHost _default_:443>
DocumentRoot "C:/your-directory"
Related Topics
Replace Any Url's Within a String of Text, to Clickable Links with PHP
Make Woocommerce Checkout Phone Field Optional Based on Shipping Country
Optimizing MySQL Fulltext Search
Laravel League/Flysystem Getting File Url with Aws S3
How to Require PHP Files Relatively (At Different Directory Levels)
Typecasting VS Function to Convert Variable Type in PHP
PHP MySQL - Insert into Without Using Column Names But with Autoincrement Field
How to Make a Chat Room Script with PHP
Get First Element in PHP Stdobject
How to Route Get and Post for Same Pattern in Laravel
How to Use PHPize After Update to MACos Mojave
How to Retrieve Date from Table Cell Using PHPspreadsheet
How to Install Gmp for PHP7 on Ubuntu
Can a PHP File Name (Or a Dir in Its Full Path) Have Utf-8 Characters