[HELP] some RewriteRules won't work

#1
First I want to thank the OpenLitespeed community for making this amazing fast webserver!

We have moved our site to a new server with openlitespeed.

Now we are stuck at some rewrite rules.

Maybe someone from this forum can help us?

our site is: https://www.cazin.net/

now we need a rewrite rule for:

https://www.cazin.net/vjesti/sitemap should go to https://www.cazin.net/sitemap.xml

Code:
RewriteRule ^sitemap.xml$ vijesti/sitemap [L]
this code above won't work.

also we want to redirect all mobile browsers to our mobile optimized page:

https://www.cazin.net/mob

Code:
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|ipad|iphone|ipod|opera mobile|palmos|webos" [NC]
RewriteRule ^$ https://www/cazin.net/mob [L,R=302]
yes, this code above also won't work :(


and now here is our actual rewrite code for our site (all other stuff is working)

Code:
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{THE_REQUEST} !/system/.*
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,L]
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
Thanks for any help!

makcode
 

lsfoo

Administrator
#2
Hi makcode,

Thanks for the kind words!

In the rewrite rule section of the vhost configurations, please set rewrite logging to '9'. Then, when you access the relevant pages, you will be able to see what was compared in the log.

If it's still unclear, send me the log and I'll be happy to help review the messages :)

Kevin
 
Top