WordPress Permalinks htaccess set up

Colcol

New Member
#1
Sorry, newbie question.

I followed these instructions (https://www.litespeedshare.net/snip...#9M2wLSn9rJsZ8vo8df2ktm66hC5ZvQRxWtN9fyHSQGNx) and set up WordPress. Seems to be working fine.

Just wondering about the htaccess file. All I have is this:

RewriteEngine On
RewriteCond %{HTTP_HOST} !domain\.com [NC,OR]
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://domain.com/$1 [R=301,L]

WordPress documentation refers to handling permalinks for Apache:
https://wordpress.org/support/article/htaccess/

Can someone confirm whether those Apache rewrites are not needed for OLS?

This document (https://openlitespeed.org/kb/wordpress/#Add_a_Rewrite_Rule_in_the_vHost_to_Make_Permalinking_Work) suggests all that is needed to make permalinking work for WordPress is to ensure two settings are set to Yes.

I have set both of those settings to Yes, so I assume I have everything done correctly.

Any explanation/confirmation appreciated.
 

Cold-Egg

Administrator
#2
Hi,
Those rules should be generated by WordPress. Could you go to WordPress admin page > Settings > Permalinks, just click the Save Changes button and see how it works?
It might be due to a permission issue if the rules are still not show.
 

Colcol

New Member
#3
Hi,
Many thanks. I now understand what happens and everything seems to be working.
From a clean WP install via WP-CLI, the .htaccess does not include any of the directives. Going into Settings > Permalinks, changing from Plain to another setting, then Save, then places those directives into .htaccess. So using a Plain permalink setting appears not to need the directives, but every other permalink setting does. I now also understand why a WP migration to OLS failed when I removed these directives -- that site did not use Plain permalinks.
 
Top