I'm new to htaccess and I'm searching for a way to get an internal redirect to set 2 URLs to different folders.
example.com/cms/
and everything behind the /cms/ needs to go to
rootfolder
-> cms
example.com/
(the rest of the pages)
needs to go to
rootfolder
-> public
Try addng this to your htaccess file in your document root:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/cms
RewriteCond %{REQUEST_URI} !^/public
RewriteCond %{REQUEST_URI} !-f
RewriteCond %{REQUEST_URI} !-d
RewriteRule ^(.*)$ /public/$1 [L]
Essentially:
/cms
, let it get resolved to /cms
directly/public
, let it get resolved directly/public
in front of the URI