Hello there I am using cpanel. In the cpanel, I created a redirect, which created an .htaccess like this.
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteOptions inherit
Options -Indexes
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php73” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php73 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
RewriteCond %{HTTP_HOST} ^paw\.xevz\.migor\.eu$ [OR]
RewriteCond %{HTTP_HOST} ^www\.paw\.xevz\.migor\.eu$
RewriteRule ^/?$ "http\:\/\/paw\.xevz\.migor\.eu\/mainfolder" [R=301,L]
The problem with this, when I added new folder my public directory and view my page, it will always redirect to the 'mainfolder'. How will I add a RewriteCond that will not redirect to the main folder if my link is something like http://paw.xevz.migor.eu/subfolder ? I tried like this,
RewriteCond %{REQUEST_URI} !^/subfolder/
RewriteCond %{HTTP_HOST} ^paw\.xevz\.migor\.eu$ [OR]
RewriteCond %{HTTP_HOST} ^www\.paw\.xevz\.migor\.eu$
RewriteRule ^/?$ "http\:\/\/paw\.xevz\.migor\.eu\/mainfolder" [R=301,L]
but no luck. Please help thank you.
P.S. Those links in my .htaccess are just sample.