O
O
ortsuev332019-11-29 18:36:25
htaccess
ortsuev33, 2019-11-29 18:36:25

How to combine these two rules?

<IfModule mod_rewrite.c>
RewriteEngine on
#RewriteCond %{REQUEST_URI} !^public
#RewriteRule ^(.*)$ public/$1 [L]
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}/public [R=301,L]
</IfModule>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-11-29
@ortsuev33

RewriteEngine on

RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]

RewriteCond %{REQUEST_URI} !^/public/
RewriteRule (.*) public/$1 [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question