Help with .htaccess file

#1
Hello, all. I'm a web designer, not a server person, but over a week ago my hosting provider switched from straight Apache to LWS and my pretty URLs are no longer working. I was hoping someone here can help me out, because the support at said hosting seems to not have a clue (it's been 9 days).

The new server is running LiteSpeed/5.4.8 Enterprise.

The line in question that's failing is this:

Code:
RewriteRule ^essays/([^/]*)$ /essays?essay=$1 [L]
I tried putting ^/?essays... along with some other lines about LWS cache I've read elsewhere, but I'm not sure what the disconnect is. Any help would be greatly, greatly appreciated.

Thank you,
Abby
 
#3
Thank you. I have removed the [L], but the pages still come back as 404 error. Here is my full .htaccess:

Code:
ErrorDocument   404     /404.php

<IfModule LiteSpeed>
CacheLookup public on
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^blog/([^/]*)$ /blog?essay=$1
RewriteRule ^services/([^/]*)$ /services?service=$1
RewriteRule ^([A-Za-z0-9-]+)$ $1\.php [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L, R=301]
</IfModule>

# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php5_module>

</IfModule>
# END cPanel-generated php ini directives, do not edit

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php72” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php72 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
This rule:
Code:
RewriteRule ^([A-Za-z0-9-]+)$ $1\.php [NC]
appears to be working just fine, but whenever I try to go to my /blog/blog-entry-slug page, it returns a 404 error (this was all working like a champ before they migrated my accounts to a LWS server.

Thank you again!

—Abby
 
#5
it turns out that I had to explicitly call the file with the .php extension for it to work. Thank you for your help!

Code:
RewriteRule ^blog/([^/]*)$ /blog.php?essay=$1
 
Top