Need Rewrite Rules Help Please

#1
Hello fellow OLS Forums members,

i'm trying since hours to get my head around on why are the following rewrite rules are not working. I had that project before running on Apache for years without any problem but want to switch to OLS now. Here are the rules:

Apache config:
AddType application/x-httpd-lsphp .php .phtml .html .htm
AddHandler application/x-httpd-lsphp .php .phtml .html .htm

RewriteEngine on
Options +FollowSymlinks
Options +MultiViews
RewriteBase /

RewriteCond %{HTTP_USER_AGENT} ^$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/[0-9]\.[0-9]$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^.*(BaiduSpider|YandexBot|AhrefsBot|SiteBot|SEOkicks|SISTRIX|SemrushBot|MajesticSEO|SMTBot|spbot|MJ12bot|BLEXBot).*$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^.*(ia_archiver|BacklinkCrawler|Twiceler|download|GigaBot|TechrigyBot|SBIder|Jakarta|BacklinkCrawler|MegaIndex).*$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^.*(Wget|Python|Java|Jakarta|WebAlta|Cityreview|DoCoMo|veoh-|relevantnoise|HTMLParser|Moreoverbot).*$ [NC]
RewriteRule ^.* - [F,L]

RewriteCond %{HTTP_HOST} ^www\.mydomain\.com
RewriteRule (.*) http://mydomain.com/$1 [R=301]

RewriteRule ^/([-0-9a-z]+)/([-a-z]+)-([0-9]+)\.jpg$ /img/$3.jpg

RewriteRule ^/([-0-9a-z]+)\.html$ page.php?page=$1 [L]

RewriteRule ^/feed$ /feed/ [R=301]
RewriteRule ^/feed/$ indexfeed.php [L]

RewriteRule ^/([-0-9a-z]+)/feed$ $1/feed/ [R=301]
RewriteRule ^/([-0-9a-z]+)/feed/$ feed.php?city=$1 [L]

RewriteRule ^/([-0-9a-z]+)/([-0-9a-z]+)/contact-([-0-9a-z-]+)$ $1/$2/contact$3.html [R=301]
RewriteRule ^/([-0-9a-z]+)/([-0-9a-z]+)/contact-([-0-9a-z-]+).html$ contact.php?city=$1&topic=$2&page=$3 [L]

RewriteRule ^/([-0-9a-z]+)/([-0-9a-z]+)/send-([-0-9a-z-]+)$ $1/$2/send$3.html [R=301]
RewriteRule ^/([-0-9a-z]+)/([-0-9a-z]+)/send-([-0-9a-z-]+).html$ send.php?city=$1&topic=$2&page=$3 [L]

RewriteRule ^/([-0-9a-z]+)/([-0-9a-z]+)$ $1/$2/ [R=301]
RewriteRule ^/([-0-9a-z]+)/([-0-9a-z]+)/$ topic.php?city=$1&topic=$2 [L]

RewriteRule ^/([-0-9a-z]+)$ $1/ [R=301]
RewriteRule ^/([-0-9a-z]+)/$ topic.php?city=$1 [L]
On restarting OLS at the OLS Panel i'm getting 2 errors wich are saying:
Invalid rewrite directive: AddType application/x-httpd-lsphp .php .phtml .html .htm
Invalid rewrite directive: AddHandler application/x-httpd-lsphp .php .phtml .html .htm

1.) Question: How do i tell OLS to process .htm and .html files as php?
2.) Question: Is there anything wrong with my rewrite rules above? I added the Slash after the caret already but with all the sprinkled and sometimes incomplete tips on how to convert Apache rewrite to Litespeed rewrite rules, i just wasn't able to make these things run smooth.

I'm thankful for every help and hint. Thank you very much for your time.

Best regards, Thomas
 

lslisa

Administrator
#3
Hi, Maxxom.

I'm going to leave this post here, as it may be helpful to someone else having the same problem :)

Thanks for letting us know it's been solved!
Lisa
 
Top