tags:

views:

22

answers:

3

Can i set a 301 redirect into a rewrite rule?

eg can i set a 301 redirect into this code?

RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2&isolang=$1$4 [L,E]
+1  A: 

If you just want Apache to treat your static URL as something your PHP script is interested in, you should not need to set a 301 response code for your static page. A 3xx response code is only used when you're redirecting somebody from page A to page B with a change in the URL.

BoltClock
A: 

For some reason this redirects to the dynamic url and not the static url which i want it to direct to. Thanks for that but please tell me how to set it to the static url.

ali demirtas
so what do you reccommend? I hav be enabled static urls and i do not want the previous urls to which are dynamic to be indexed. Which ever url is used to accesd the site i want people to be directed to the newest static url.
ali demirtas
A: 

so what do you reccommend? I hav be enabled static urls and i do not want the previous urls to which are dynamic to be indexed. Which ever url is used to accesd the site i want people to be directed to the newest static url.

ali demirtas