How do I redirect root to subfolder

Problems with the Windows version of XAMPP, questions, comments, and anything related.

How do I redirect root to subfolder

Postby johnGH » 01. October 2020 21:24

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
johnGH
 
Posts: 1
Joined: 01. October 2020 21:14
XAMPP version: 7.2.32
Operating System: Windows 10

Re: How do I redirect root to subfolder

Postby Nobbie » 01. October 2020 23:04

Delete all rewrite stuff, simply assign DocumentRoot to c:/xampp/htdocs/subfolder in your VirtualHost
Nobbie
 
Posts: 13214
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 106 guests