Redirect a blog to the main site


#1

Hi!

a few years ago, somebody created the website for our association : www.nursingmothersalliance.org
We wanted to upgrade it and try wordpress so I one-click install it with a new address : www.nursingmothersalliance.org/blog
while the main website was still online to not interrupt anything.

How can I redirect or put the wordpress files into the main website (without /blog at the end)?

many thanks!!!


#2

a few different methods depending on what you want to accomplish with it. first is to just simply copy the file set int he subdirectory over and reconfigure wordpress to the new location. can be a pain sometimes.

if you dont mind having /blog in the url, a simple php location call will work just fine
[php]<?php
header(“Location: http://url/subdir”);
?>[/php]

or something like thisin an .htaccess file on the main domain…

RewriteCond %{HTTP_HOST} ^(www.)?URLHERE.net
RewriteCond %{REQUEST_URI} !^/subdirectory
Rewriterule ^(.*)$ /blog/$1 [L]

i personally prefer to just move all the file in the long run, but then again, i never did it on my own domain, so it’s sort of moot :slight_smile:


#3

thanks!

in fact I tried to reconfigure wordpress last time (with nursing…org/main & not blog), and now I can’t access it!!
where should I redirect it, maybe I got it wrong?[hr]
I’m trying to copy my files but can’t access webftp…
any idea?


#4

When I’m lazy, I use the panel here and go to Manage Domains and click Edit for my hosted domain. Then I change the Web Directory path so instead of /home/USER/example.org, I add /blog so it reads /home/USER/example.org/blog
And then go into WordPress wp-admin general settings and update the URL.

When I’m not lazy, I use pyr02k1’s method which is the clean way to do it.


#5

thanks!