I have the following .htaccess to deal with different ways of accessing the same page:
RewriteRule ^([0-9a-zA-Z]+)$ index.php?p=$1
RewriteRule ^([0-9]+)/([a-z0-9-]+)/$ index.php?sa=$1&sb=$2
The first rule matches any short URL, e.g. http://[mysite]/p8Dn, and translates it to the internal id for the requested page. This works fine.
The second rule looks for a URL like
and extracts the two parts, which PHP uses to locate the page id as before. This generates exactly the same HTML but none of the images (on relative paths) get shown and the local CSS seems to be ignored too.
Is it a path problem? Do I need to use RewriteBase, and if so, how?