.htaccess - htaccess redirection and rewrite from php to html -


I'm stuck with the .htaccess modification, requires a little help.
First, it inside my htaccess

  RewriteRule ^ (. *). Html $ $ 1.php [nc]   

For example, I've created a file named test.php and uploaded it to my server.

I want my server to behave this way.

  http://example.com/test/test.html - & gt; Http://example.com/test/test.html It is like this) http://example.com/test/test.php - & gt; Http://example.com/test/test.html   

But with .htaccess I have just now, I still have both .php and .html which are considered as file duplication Like Google Robot, by search engine crawler (is not it?).

Any help appreciated.

Try this .htaccess code

  # # Friendly friendly URL rewriter ^ test / (. *) \. HTML $ test / $ 1 \ .php [re-enable Engine Restart Engine]   

OR

  Rewrite% {REQUEST_URI} ^ (. *) \. Php $ RewriteRule ^ (. *) / $ 1.html [L]   

OR

  Options + Foloamilink -maltiaiwug # turn mod_rewrite /test/test.html Reedaitkand% on .html # externally /test/test.php on RewriteBase on RewriteEngine / # # .php {THE_REQUEST} ^ [AZ] {3,} \ s ([^ .] +) \ Php [NC] rewriting rule ^% 1.html [R, L, NC]    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -