Report this

What is the reason for this report?

Redirect .htaccess only when no subdomain

Posted on March 8, 2020

Hello. I have a .htaccess who redirect all request do the /public/ directory. But i want only redirect when no subdomain… Actual .htaccess :

RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} /public/([^\s?]*) [NC]
RewriteRule ^ %1 [L,NE,R=302]
RewriteRule ^((?!public/).*)$ public/$1 [L,NC]

Thanks.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.