htaccess hidden redirect
by Ramya[ Edit ] 2009-11-05 17:29:05
htaccess hidden redirect:
To redirect a page using htaccess use "Redirect" keyword as:
Redirect /index.php http://hscripts.com/index.php
To hidden redirect the page, use:
RewriteEngine On
RewriteRule ^test.html index.html [L]
For hidden redirect in htaccess use the flag [L].
If you use [L], the page will be redirected but the url wont change ie, hidden redirect.
Redirect condition:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/test/(.*)/index.php
RewriteRule ^test/(.*)/index.php http://hscripts.com/test/test1.php?fname=$1 [L]
Important Note: Whenever you use "RewriteCond" & "RewriteRule", you must add the line,
RewriteEngine On
Rewrite rules will work only if the RewriteEngine is On.