Sorry if this is really simple! I'm not experienced with htaccess rewrites, so I'm just feeling my way around.
I have this URL
/category.php?cat=projects/retail/
But I want rewrite it as a clean URL, so it looks like this:
/category/projects/retail/
I've written this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^category.php/([a-zA-Z0-9-/]+)$ /category?s=$1 [L]
</IfModule>
I found a good article on media temple Using .htaccess rewrite rules. This explains a bit about the structure of rewrite rule - but I'm still a bit stuck
I know ^
starts the URL to match and $
ends it. After the $
the second string defines the new URL.
So this bit after the RewriteRule
^category.php/([a-zA-Z0-9-/]+)$
Defines the original URL, I think the content within the ([a-zA-Z0-9-/]+)
means match uppercase, lowercase and hyphens.
I also know [L]
tells the server to stop
What I don't know is how to rewrite the URL - yet!
Can anyone help?