php - htaccess mod rewritten urls, 301 redirect on dynamic page? -
i utilizing mod-rewrite , htaccess file translate query string urls friendly ones. these products pull database , populate single dynamic php file - product1.php.
i introduced rewrite function , have seen site traffic plummet. thinking because need add 301 redirects rewritten urls. (i have noticed massive spike in url errors, nonsensical, reason.)
can use 301 redirects if it's 1 file (product1.php), url's different; and, if so, how write it? have searched specific question, no luck.
fyi, here's have in htaccess utilizing mod-rewrite:
rewriteengine on #redirect requests missing "www" rewritecond %{http_host} ^example\.com$ [nc] rewriterule ^ http://www.%{http_host}%{request_uri} [ne,l,r=301] #truncate extension ".php" requests rewritecond %{the_request} /index\.php [nc] rewriterule ^(.*?)index\.php$ /$1 [l,r=301,nc,ne] #look word "category" followed slash, product type, slash, model name , model id, slash, product id rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^category/.*/.*/([0-9]+)$ product1.php?product-id=$1 [l,qsa] #rewrite static file url rewriterule ^category/subcategory/?$ subcategory-index.php [nc]
i have forty of last rewrite various static pages renaming.
thanks :)
Comments
Post a Comment