I'm having some trouble with rewriting dynamic URLs using .htaccess. The rewrite should be fairly simple, but I'm missing something and would greatly appreciate a hand.
The URL scheme:
http://www.example.com/index.php?p=/category/page-slug
should translate to:
http://www.example.com/category/page-slug
And
http://www.example.com/index.php?p=/category/&f=feed/rss
should become:
http://www.example.com/category/feed/rss
My current rewrite rule is:
RewriteRule ^(.+)?$ index.php?p=$1 [NC,L]
but that isn't working as it should. Any suggestions?
Edit: This rule is now partially working as it loads the page, but none of the page assets like my stylesheets and images are showing. I'm guessing it's because they are relative paths. Any ideas on a workaround?
RewriteRule ^([a-zA-Z0-9-/+]+)$ http://example.com/index.php?p=/$1 [L]