The MU forums have moved to WordPress.org

Rewriting the URLs (12 posts)

  1. naijin
    Member
    Posted 16 years ago #

    Hello,

    I access my main blog through http://www.blog.com/wp/
    The sub-blogs follow (www.blog.com/wp/blog1/, http://www.blog.com/wp/blog2/, etc).

    Is there a way to "by-pass" the /wp/ in the URL (without a reinstall)? Instead of having http://www.blog.com/wp/ I would have http://www.blog.com for the main blog and http://www.blog.com/blog1/, etc. for the sub-blogs?

    The physical structure is the following:
    C:\apache\htdocs\ (that's where http://www.blog.com points)
    C:\apache\htdocs\wp\ (installation)

    I tried setting the DocumentRoot to C:\apache\htdocs\wp\, but that essentially duplicates /wp/ in all links on the blog.

    I also tried playing with mod_rewrite in Apache, but that doesn't seem to work either.

    Any suggestions? Could I perhaps change some values in the DB (/wp/ to / maybe?)

    Thanks.

  2. ekusteve
    Member
    Posted 16 years ago #

    I haven't tried this specific change, but I do periodically dump the database on my production site and restore it to a test site with a different url. What I do is simply dump the database as an sql file and then do a find/replace to change all url values. I then import this to my test site and it works...seems you should be able to do the same thing.

    Just dump the database and find all references to blog.com/wp/ and replace with blog.com/ then drop the tables in your original database and import the changed database. Of course, backup your original first just in case this doesn't work :-).

    Edit...of course, you will need to move your mu files to the root as well...just be sure to backup everything just in case of disaster.

    Steve

  3. naijin
    Member
    Posted 16 years ago #

    Well, this almost works.

    The main blog is fine for the main part, however all the sub-blogs (even if I create a new one) redirect to http://www.blog.com/wp/wp-signup.php?new=%2F.

  4. andrea_r
    Moderator
    Posted 16 years ago #

    So... why can't you do a reinstall?

  5. naijin
    Member
    Posted 16 years ago #

    I can, but I rather not.

  6. ekusteve
    Member
    Posted 16 years ago #

    Just shooting in the dark here, but did you check for any other references to /wp in your exported sql file? I don't think anything gets changed in the actual core files (I don't think there is anything to change in config.php or other files), so it would probably be in the database somewhere.

    Just be sure to search for all possible instances of wp...like /wp /wp/ ....humm, well, I think that should cover it :-)

    Steve

  7. naijin
    Member
    Posted 16 years ago #

    Yeah, sure did. Actually all the links (categories, posts) bomb and redirect to http://www.blog.com/wp/wp-signup.php?new=g

    I'm leaning more and more towards a total reinstall. Sigh

  8. andrea_r
    Moderator
    Posted 16 years ago #

    Well, in this case it's less work.

  9. naijin
    Member
    Posted 16 years ago #

    Do you have any idea why it doesn't work though?

  10. ekusteve
    Member
    Posted 16 years ago #

    Just one more "shot in the dark" thought...look in .httaccess and make sure there isn't anything there causing it. Maybe in RewriteBase......

    Steve

  11. naijin
    Member
    Posted 16 years ago #

    Still nothing, but I reinstalled. Every seems OK.

    Thanks for the advice though. :)

  12. andrea_r
    Moderator
    Posted 16 years ago #

    "Do you have any idea why it doesn't work though?"

    Technically, no. :) I do know, however, that on some servers installing it in a sub-anything just won't work. Some people have managed to have it work for them, but the general consus has been we all don't know why.

    (not without being able to look at the servers in question)

About this Topic