.htaccess - PHP Redirection (301) hiding query string -
I am trying to redirect a page using PHP (I think there are several pages included and The information required to redirect is kept in a database.)
The page I am trying to redirect to has already been rewritten, and looks like this:
www.example.com/shop/deptartment/section/product1/
which rewrites for www.example.com/content.php?dept=department§=section&prod Has = Product
However, when I use the php header ($ url, TRUE, 301);
with $ url (for example) www.example.com/shop/deptartment/ section / product 2 / re-direct:
www.example.com/shop/ Deptartment / section / product2 /? Dept = department & amp; sect = section & prod = product
I want all those www.example.com/shop/deptartment/section/product2/ < / P>
I know how to stop it in .htaccess, but php, have no idea?
/ P>Many thanks,
Stuart
The rules for ps rewriting are:
rewrite rule / ([a -zA-Z0- 9 \ -_] +) / ([a-zA-Z0-9 \ -_] +) / ([A-zA-Z0- 9 \ -_] +) /? $ /content.php?dept=$1§=$2&prod=$3 [L, NC, QSA] Rev. Rule ^ Shop / ([AZA-Z0-9 \ -_] + / ([a] -zA-Z0-9 \ -_] +) /? $ / Content.php? Dept = $ 1 & sect = $ 2 [L, NC, QSA] revised rules ^ shop / ([a-zA-Z0-9 \ -_] +) /? $ / Content.php? Dept = $ 1 [L, NC, QSA] Revised Rules ^ shop / /content.php [L, NC, QSA]
Comments
Post a Comment