php - SEO friendly links with htaccess - redirecting dynamic links to static -


I have a website in which I would like to switch to SEO friendly links, to redo some work, I redirection through HTAC Would you like to add old dynamic links like:

  mydomain.com/mypage.php?id=1&something=2   

as another friend Will be directed to:

  mydomain.com/mypage/1/2/   

As far as I understand, I need those redirects, so that Search engines do not penalize me for duplicated content and since I need to do them, I thought it might be easier to change the link on each page instead of just making them - I can refer to the normal HTML form I am using it so it will not be very straight forward. I am trying to do this with code in htaccess:

  option + follow simulin rewritingIngni on rearabytebase / directory for mydomain.com/RewriteRule ^ mypage \ .php? Id = ([0-9] +) and some = ([0- 9] +) $ ^ mypage / $ 1 / $ 2 [R = 302, QSA] rewrite rule ^ mypage / ([0- 9] +) / ([0- 9] +) /? $ ^ mypage.php? id = $ 1 and amp; Something = $ 2 [QSA]   

But this is not working, I think a problem "?" In:

  ^ mypage.php? Id = ([0-9] +) ....   

I may be wrong, but many tests I concluded that I can not use it?

You can not match query string in RewriteRule . The correct way to handle it is using these rules in the DocumentRoot / .htaccess file:

  options + followAmicikk - multiviews rewriting engine on reversebase / test_redirects / #boots The URL from the redirect is actually a rewrite code% {THE_REQUEST} \ s / test_redirects / ([^.] +) \ Php? Id = ([^ \ s & amp; +]) and some = ([^ \ s & amp;] +) [NC] rewriting rule ^% 1 /% 2 /% 3? [R = 302, L] Actual one rule from the beautiful URL ^ ^ ([^ /] +) / ([0- 9] +) / ([^ /] +) /? $ $ 1. PHP ID = $ 2 and some = $ 3 [L, QSA]    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -