You're doing it the hard way. Simply put an index.php file in the current root of your webserver and make it point to your new site directory by placing this inside:
Code:
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://new.url.of.your.website.com");
exit();
?>
No messing around with .htaccess or rewrite engines required.
__________________ "Anything that is complex is not useful and anything that is useful is simple. This has been my whole life's motto." -- Mikhail T. Kalashnikov
I don't need to redirect to a whole new domain name, rather just redirect one dynamic page to another dynamic page.
It will still work. That's all I do is redirect one page to another. Here's my exact index.php file:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Redirecting you...</title>
</head>
<body style="background-color:#99ccff;padding:1.0em;">
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://three-dog.homelinux.com/phpbb/index.php");
exit();
?>
<div style="background-color:#fff7f0;width:50%;text-align:center;padding:3.0em;border:2px solid #336699;">
<a href="http://three-dog.homelinux.com/phpbb/index.php">
<span style="font-weight:bold;font-size:16px;">Please click this link if you are not automatically redirected</span>
</a>
</div>
</body>
</html>
See? All I do is redirect "index.php" from my web root to "webroot/phpbb/index.php".
Works fine.
__________________ "Anything that is complex is not useful and anything that is useful is simple. This has been my whole life's motto." -- Mikhail T. Kalashnikov
I have a landing page that I need to hit and then have that landing page redirect the user to a different page. I am stuck on keeping the URL variables in tact when the redirect happens.
so here i want to redirect for example : index.php?id=108&page=content&lang=fr
*note that i filter variable id and language in two different rewrite conditions.
Then i redirect to any page i want. Also note the ? at the end of my rewrite rule, the ? stops the automatic transmission of previous Get variables to the new redirect url.
so here i want to redirect for example : index.php?id=108&page=content&lang=fr
*note that i filter variable id and language in two different rewrite conditions.
Then i redirect to any page i want. Also note the ? at the end of my rewrite rule, the ? stops the automatic transmission of previous Get variables to the new redirect url.
if for example you have index.php?var1=232&id=108&var2=blla&lang=fr
change the
[CODE]RewriteCond %{QUERY_STRING} ^id=108
RewriteCond %{QUERY_STRING} lang=fr$
for
[CODE]RewriteCond %{QUERY_STRING} &?id=108
RewriteCond %{QUERY_STRING} lang=fr$
it will look for it where ever the var is situated in the url