Viewing 9 replies - 1 through 9 (of 9 total)
  • Well, you obviously nbeed to have the “.htaccess” file in your “root” folder for starters. The “.htaccess” file probably originally had a “RewriteBase /blog” condition. Change that to say “RewriteBase /” instead.

    Thread Starter jaced

    (@jaced)

    OK, I dicked around with the /blog/.htaccess file and got https://example.com/blog/path to redirect to https://example.com/path by putting this in the /blog/.htaccess file:

    Redirect /blog/ https://example.com/

    Seemed cool, but then weird stuff started happening. Namely:

    — The theme eventually disappeared. Content was there, but with no skin.

    — Couldn’t get into the wp-login.php file. This is probably because /blog/wp-login.php is redirecting me to a non-existent /wp-login.php

    Hmmm.

    Lemme know what you think the best option is.

    Take the “.htaccess” file out of the “/blog” folder and stick it into root.

    Thread Starter jaced

    (@jaced)

    Pizdin,

    What I’m trying to do is retain all my established links in Google. I tried using the Redirect in the /blog/.htaccess to do this.

    Is there a better way to redirect old links to the new links? As of right now, all my links from Google are going to a 404 page.

    Thx.

    In that case, I think you’re after a “301” redirect. This thread might help.

    Thread Starter jaced

    (@jaced)

    Thanks.

    I have two blogs, one in the root folder of my web site and one in a subfolder called /nyc. Do I need an .htaccess file for each? If I do, would this be correct for the following line of code in each case?

    For the nyc folder: RewriteBase /nyc

    For the root folder: RewriteBase /

    This is by the way my current setup. If I activate permalinks in other than default on the nyc blog, I get 404 pages for every slug page, but with the template of the root blog!?! Isn’t that weird?

    They are completely different settings and also different dbs. I am confused.

    Thread Starter jaced

    (@jaced)

    Guys,

    The 301 redirect seems to conflict with the notion that we can store our core WP files in a different location that our blog address.

    When we tweak .htaccess to redirect anything, we’re basically hosing ourselves. WP can’t find themes, nor can it get to the admin.

    I can’t be the only dude who’s wrestled with this. What’s going on? Must I actually move the core files to the root?

    Seems that if we do indeed want to move our WP files to another directory, we can. The catch: all our existing links turn up 404.

    “Must I actually move the core files to the root?”

    The “default” for WP seems to be to have all the core files in root and configure admin “options > general” to say:

    WordPress address (URI): https://localhost/wp
    Blog address (URI): https://localhost/wp

    Based on the handful of WP installations I’ve done, I have always placed all the WP core files in a subdirectory called “/blog”, except for “index.php” and “.htaccess”, which I’ve put in root. In admin “options > general” I’ve then used:

    WordPress address (URI): https://localhost/wp/blog
    Blog address (URI): https://localhost/wp

    This approach requires a modification of “index.php” to say:

    require(‘./blog/blog-header.php’);

    This has always worked for me. I understand the WP has drastically “simplified” the stuff that goes into “.htaccess” since V2, so there shouldn’t be much in that file that might confuse the web server.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘.htaccess after moving WP’ is closed to new replies.