Hi
I'm struggling with these rules that I moved from apache (.htaccess) to OLS (vhost static context "/").
The last rule that works is: "RewriteCond %{HTTPS} off [OR]".
After that, no other rule works and I get 404 errors
What am I doing wrong?
Thanks
I'm struggling with these rules that I moved from apache (.htaccess) to OLS (vhost static context "/").
The last rule that works is: "RewriteCond %{HTTPS} off [OR]".
After that, no other rule works and I get 404 errors
What am I doing wrong?
Thanks
Code:
RewriteEngine On
# Cache
RewriteCond %{HTTP_COOKIE} !(xf_lscxf_logged_in|xf_user|xf_session_admin) [NC]
RewriteCond %{REQUEST_URI} !/install/ [NC]
RewriteRule .* - [E=Cache-Control:max-age=360,E="cache-vary:xf_style_id,xf_language_id"]
# No Cache
RewriteCond %{HTTP_COOKIE} (xf_lscxf_logged_in|xf_user|xf_session_admin) [NC]
RewriteRule .* - [E=Cache-Control:vary=loggedin,E=Cache-Control:no-cache]
# Xenforo
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
# Rewrite https and www
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(.*)$ [NC]
RewriteRule (.*) https://www.example.com/$1 [R=301,L]
# vBseo -> IPB
RewriteRule ^forum/f[\d]+/.+-([\d]+)/index([\d]+).html$ /forum/showthread.php?t=$1&page=$2 [L,R=301]
RewriteRule ^forum/f[\d]+/.+-([\d]+)/?$ /forum/showthread.php?t=$1 [L,R=301]
RewriteRule ^forum/f[\d]+/.+-([\d]+)-post[\d]+/?$ /forum/showthread.php?t=$1 [L,R=301]
RewriteRule ^forum/f([\d]+)/index([\d]+).html$ /forum/forumdisplay.php?f=$1&page=$2 [L,R=301]
RewriteRule ^forum/f([\d]+)/$ /forum/forumdisplay.php?f=$1 [L,R=301]
RewriteRule ^forum/$ / [L,R=301]
RewriteRule ^galeria/$ /media/ [L,R=301]
# /vBseo -> IPB
# IPB -> XF
RewriteRule ^forum/(\d+)-(.+)/page-(\d+) /forums/$2.$1/page-$3? [L,R=301]
RewriteRule ^forum/(\d+)-([^\/]*) /forums/$2.$1/? [L,R=301]
RewriteRule ^topic/(\d+)-(.+)/page-(\d+) /threads/$2.$1/page-$3? [L,R=301]
RewriteRule ^topic/(\d+)-([^\/]*) /threads/$2.$1/? [L,R=301]
RewriteRule ^gallery/category/(\d+)-([^\/]*) /media/categories/$2.$1/? [L,R=301]
RewriteRule ^gallery/album/(\d+)-([^\/]*) /media/albums/$2.$1/? [L,R=301]
RewriteRule ^gallery/image/(\d+)-([^\/]*) /media/$2.$1/? [L,R=301]
RewriteRule ^gallery /media/? [L,R=301]
RewriteRule ^user/(\d+)-([^\/]*) /members/$2.$1/? [L,R=301]
RewriteRule ^(blogs|blog) /? [L,R=301]
# /IPB -> XF
# Local rewrite rules
RewriteRule ^go/regras /help/rules [L,R=301]
RewriteRule ^go/termos /help/terms [L,R=301]
RewriteRule ^go/privacidade /help/privacy-policy [L,R=301]
RewriteRule ^go/fotos /threads/colocar-fotos-nas-mensagens.165/ [L,R=301]
RewriteRule ^go/videos /threads/colocar-videos-nas-mensagens.260/ [L,R=301]
# /Local rewrite rules