Forum Moderators: phranque
.htaccess:
RewriteRule ^main\.html$ main.php [T=application/x-httpd-php] [L]
main.php:
header("Location: main.html");
Is there a way that the rewrite can know to do the rewrite to main.php ONLY once for this sequence, somehow to 'remember'?
If you use an external redirect - as in your script 'Location' header - then that is returned to the client browser, the browser then creates a *new* HTTP request, and the server will have no memory of the previous request. So, it will loop forever.
Perhaps you can use different names (for example, main1, main2, etc.) to accomplish what you want. Or you can use session variables, cookies, and all that stuff to track the user and control the path.
Jim