I have a page
http://www.example.com/category.php?category=business
and have rewritten it to
http://www.example.com/business
using the below code
- Code: Select all
RewriteRule ^([-a-z0-9_]+)/?$ /category.php?category=$1 [NC,L]
now google can see this same page with 2 urls ... so I need to get a 301 redirect to the .php page
which I almost successfully did by using the below code
- Code: Select all
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{QUERY_STRING} ^(.*&)?category=([^&]+)(&.*)?$ [NC]
RewriteRule ^category\.php$ /%2/? [R=301,L]
RewriteRule ^([-a-z0-9_]+)$ /category.php?category=$1 [L]
I dont know if I am correct... but the page results in redirecting it to
http://www.example.com/business/
with a trailing / at the end ?
If I am right at this... is this working correctly ? how can I remove the trailing slash to make it
http://www.example.com/business
thanks in advance