Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Save as rewrite.php:
- <html>
- <body>
- <?php
- if($_GET['link'] == 1){
- echo "not using mod_rewrite";
- }
- elseif($_GET['link'] == 2){
- echo "works! using mod_rewrite";
- }
- ?>
- <a href="rewrite.php?link=1">Test 1</a> = rewrite.php?link=1<br>
- <a href="link2.html">Test 2</a> = link2.html
- </body>
- </html>
- Save as .htaccess in same folder:
- RewriteEngine On
- RewriteRule ^link([^/]*).html$ rewrite.php?link=$1 [L]
Add Comment
Please, Sign In to add comment