Hello,
I'm trying to put together a fairly simple rewrite rule but for some reason I can't succeed
It should do the following:
domain.com/test_dir/category/order_by/order_by_period/page ->
domain.com/test_dir/page.php?c=category&o=order_by&op=order_by_priod&p=page
where category, order_by, order_by_period are lists of words (eg: funny|news..) and page a number. Each of these may or may not exist
domain.com/test_dir/
domain.com/test_dir/category/
domain.com/test_dir/category/order_by/
domain.com/test_dir/category/order_by/order_by_period
domain.com/test_dir/category/order_by/order_by_period/page
Only condition is order_by_period may be present only if order_by is present
This is what I came up with:
RewriteEngine on
RewriteBase /test_dir
RewriteCond %{REQUEST_FILENAME} !-d [OR]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^((categ1|categ2)/)?((order_by1|order_by2)/)?(?<=((order_by1|order_by2)/)(order_by1_period|order_by2_period))?([1-9]?[0-9]*/)? page.php?categ=$2.. [L]
My first problem is .css file doesn't load. I understood why and that the solution to it is to use:
RewriteCond %{REQUEST_FILENAME} !-d [OR]
RewriteCond %{REQUEST_FILENAME} !-f
Still didn't work
Hope this is not too hard to follow
Thank you in advance
Catalin