Page 1 of 1

How do I redirect root to subfolder

PostPosted: 01. October 2020 21:24
by johnGH
Hi, trying to redirect traffic that land on http://site.dev/dashboard/ to http://site.dev/subfolder (C:\xampp\htdocs\subfolder)

Host File
Code: Select all
127.0.0.1      site.dev


httpd-vhosts.conf
Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
   ServerName site.dev
   RewriteEngine On
   RewriteRule "^site.dev$"  "site.dev\subfolder" [R]
   DocumentRoot "C:/xampp/htdocs"
   <Directory "C:/xampp/htdocs">
      Options Indexes FollowSymLinks Includes ExecCGI
      AllowOverride All
      Require all granted
   </Directory>
</VirtualHost>


The result is I end up on the XAMMP Dashboard still not the subfolder thats in my C:\xampp\htdocs\subfolder

Re: How do I redirect root to subfolder

PostPosted: 01. October 2020 23:04
by Nobbie
Delete all rewrite stuff, simply assign DocumentRoot to c:/xampp/htdocs/subfolder in your VirtualHost