.htaccess rewrite help
need a bit of help rewriting urls with variables.
I have the following URL:
http://www.somedomain.com/main-news/news-item.php?news=47
and would like to be able to use:
http://www.somedomain.com/main-news/news-item/47/
So i have rewritten my .htaccess file to have the following in it (as suggested by http://www.webconfs.com/url-rewriting-tool.php):
Options +FollowSymLinks
RewriteEngine on
RewriteRule news-item/(.*)/ news-item.php?news=$1
but this just isn't working. my .htaccess file is in the root directory, and has been doing 301 redirects just fine for many months now. Any obvious flaws in what i'm writing in my code? does RewriteRule need to go before RedirectMatch or does it not matter?
I'd also like the site redirect anyone typing in the first url format to the second url style, for pages already listed in the search engines. How would i write that?
Thanks in advance for any help or tips! :)
paul
x
I have the following URL:
http://www.somedomain.com/main-news/news-item.php?news=47
and would like to be able to use:
http://www.somedomain.com/main-news/news-item/47/
So i have rewritten my .htaccess file to have the following in it (as suggested by http://www.webconfs.com/url-rewriting-tool.php):
Options +FollowSymLinks
RewriteEngine on
RewriteRule news-item/(.*)/ news-item.php?news=$1
but this just isn't working. my .htaccess file is in the root directory, and has been doing 301 redirects just fine for many months now. Any obvious flaws in what i'm writing in my code? does RewriteRule need to go before RedirectMatch or does it not matter?
I'd also like the site redirect anyone typing in the first url format to the second url style, for pages already listed in the search engines. How would i write that?
Thanks in advance for any help or tips! :)
paul
x
