Hi all! First post here....
I had some rewrite rules in apache working without any problem. Here they are:
# BEGIN Wordpress
<IfModule mod_rewrite.c>
RewriteEngine on
# behind proxy
RewriteCond %{HTTP:X-FORWARDED-PROTO} ^http$
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]
# plain
RewriteCond %{HTTP:X-FORWARDED-PROTO} ^$
RewriteCond %{REQUEST_SCHEME} ^http$ [NC,OR]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]
# wordpress in subfolder subf
RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$
RewriteCond %{REQUEST_URI} !^/subf/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /subf/$1
RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$
RewriteRule ^(/)?$ subf/index.php [L]
</IfModule>
# END Wordpress
I migrated to Openlitespeed. I saw there is a conversion to be made at the link:
https://open.litespeedtech.com/kb/apache-rewrite-rules-in-openlitespeed/
I tried to modify the rewriterules like the following (and many other ways), but I don't get the syntax right and struggle to find a solution.
I'd like wordpress to be in subfolder subf and when visitor go to mysite.com the website will show wordpress installation in folder mysite.com/subf
# BEGIN Wordpress
<IfModule mod_rewrite.c>
RewriteEngine on
# behind proxy
RewriteCond %{HTTP:X-FORWARDED-PROTO} ^http$
RewriteRule /.*) https://%{HTTP_HOST}/$1 [R=301,L]
# plain
RewriteCond %{HTTP:X-FORWARDED-PROTO} ^$
RewriteCond %{REQUEST_SCHEME} ^http$ [NC,OR]
RewriteCond %{HTTPS} off
RewriteRule /.*) https://%{HTTP_HOST}/$1 [R=301,L]
# wordpress in subfolder subf
RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$
RewriteCond %{REQUEST_URI} !^/subf/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/.*)$ /subf/$1
RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$
RewriteRule ^//)?$ subf/index.php [L]
</IfModule>
# END Wordpress
Any help would be really appreciated, thanks!
I had some rewrite rules in apache working without any problem. Here they are:
# BEGIN Wordpress
<IfModule mod_rewrite.c>
RewriteEngine on
# behind proxy
RewriteCond %{HTTP:X-FORWARDED-PROTO} ^http$
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]
# plain
RewriteCond %{HTTP:X-FORWARDED-PROTO} ^$
RewriteCond %{REQUEST_SCHEME} ^http$ [NC,OR]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]
# wordpress in subfolder subf
RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$
RewriteCond %{REQUEST_URI} !^/subf/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /subf/$1
RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$
RewriteRule ^(/)?$ subf/index.php [L]
</IfModule>
# END Wordpress
I migrated to Openlitespeed. I saw there is a conversion to be made at the link:
https://open.litespeedtech.com/kb/apache-rewrite-rules-in-openlitespeed/
I tried to modify the rewriterules like the following (and many other ways), but I don't get the syntax right and struggle to find a solution.
I'd like wordpress to be in subfolder subf and when visitor go to mysite.com the website will show wordpress installation in folder mysite.com/subf
# BEGIN Wordpress
<IfModule mod_rewrite.c>
RewriteEngine on
# behind proxy
RewriteCond %{HTTP:X-FORWARDED-PROTO} ^http$
RewriteRule /.*) https://%{HTTP_HOST}/$1 [R=301,L]
# plain
RewriteCond %{HTTP:X-FORWARDED-PROTO} ^$
RewriteCond %{REQUEST_SCHEME} ^http$ [NC,OR]
RewriteCond %{HTTPS} off
RewriteRule /.*) https://%{HTTP_HOST}/$1 [R=301,L]
# wordpress in subfolder subf
RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$
RewriteCond %{REQUEST_URI} !^/subf/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/.*)$ /subf/$1
RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$
RewriteRule ^//)?$ subf/index.php [L]
</IfModule>
# END Wordpress
Any help would be really appreciated, thanks!