How to redirect Wordpress to index?
How to redirect Wordpress to index?
- Started
- Last post
- 3 Responses
- bigtrickagain0
<meta http-equiv="refresh" content="0;url=http://http://www.mydomain.com/index.php">
put that in an index.html or index.php file and drop it in the /wp/ directory.
- bigtrickagain0
if you want logged-in wordpress users to be able to access /wp/, use this in index.php on that page:
<?php
if ( is_user_logged_in() == false ) {
?>
<meta http-equiv="refresh" content="0;url=http://http://www.mydomain.com/index.php">
<?php
};
?>
- nb0
^ Thanks! That was so simple, I didn't occur to me.
I did a little further research and it looks like the meta refresh is deprecated. Instead I used a 301 refresh by using the following as my /wp/index.php:
?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.mydomain.com/");…
exit();
?- And it seems to work for wp-created pages within the /wp/ directory. Bonus.nb