Guest User

Untitled

a guest
Jul 16th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. Save as rewrite.php:
  2. <html>
  3. <body>
  4. <?php
  5. if($_GET['link'] == 1){
  6. echo "not using mod_rewrite";
  7. }
  8. elseif($_GET['link'] == 2){
  9. echo "works! using mod_rewrite";
  10. }
  11. ?>
  12. <a href="rewrite.php?link=1">Test 1</a> = rewrite.php?link=1<br>
  13. <a href="link2.html">Test 2</a> = link2.html
  14. </body>
  15. </html>
  16.  
  17.  
  18. Save as .htaccess in same folder:
  19. RewriteEngine On
  20. RewriteRule ^link([^/]*).html$ rewrite.php?link=$1 [L]
Add Comment
Please, Sign In to add comment