Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter kensavage

    (@kensavage)

    I can’t be the only one wanting to do this…

    I have a similar issue, but I have scoured WP and not located a fix. I have also found the forums to sometimes be slow.

    Redirects is one topic that a lot of people have begun threads on and no one has found a resolution as far as I can tell. I have combed through over 40 WP forums topics. So far, nothing.

    If I find something, I will let you know.

    Thread Starter kensavage

    (@kensavage)

    Same for me, 4evrblu.

    See if this works for you:
    http://wordpress.org/support/topic/100781?replies=4#post-499022
    (read the comments, too, on the plugin’s page!)

    Here is what I did!

    I used my .htaccess file and coded it thusly:

    # 301 Permanent Redirects
    Redirect 301 /body-buddy http://totalphysiqueonline.com/anatomy-chart/
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    Pay very close attention to the syntax here. Pay attention to the non-use of foward slashes in the 301 redirects.

    In the first instance:

    Redirect 301 /body-buddy http://totalphysiqueonline.com/anatomy-chart/

    “/body-buddy has no forward slash at the end of it. I also omitted the entire URL up to and including the first forard slash followed by the name of the file that is the offending file/url, which is the file I do not want people to see and the one they need to be redirected FROM.

    In this case the old URL was:

    http://totalphysiqueonline.com/body-buddy/

    I removed http://totalphysiqueonline.com

    then and I inserted a space and then the URL that I want to redirect TO, followed by a forward slash. So you end up with:

    Redirect 301 /body-buddy http://totalphysiqueonline.com/anatomy-chart/

    If this gives you trouble or you do not understand, drop me a line here and I will get back to you and try to explain more.

    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.

    jaced – have you looked over Giving_WordPress_Its_Own_Directory?

    Hi Handy,

    Indeed I have. I’ve been reading through all these forums and I think I may have run into something unique. I have two distinct things I need to do, and they seem to be incompatible with one another.

    My problem’s not about getting WP into its own directory. That works fine. The problem is getting my existing (Google) links to redirect to the new location.

    My blog’s currently in a subdirectory, and I want it in the root. I’ll break it down real quick:

    1. My blog has been in http://example.com/blog/

    So I’m halfway there, right? That is, my core files are ALREADY in another location.

    2. I want to have my blog answer to http://example.com

    OK, now, the thread you speak of outlines this clearly, but it’s somewhat backwards from my set-up. In my situation, my files are ALREADY in a new location other than the root. So I’m good to go. What I did is simply copy my index.php and .htaccess files to the root, tweak the index.php file as instructed, and I was off and rolling. On the surface.

    The problem:

    My old links, such as http://example.com/blog/archive/article

    now throw up a 404 error.

    So I’m faced with looking into a proper redirecting solution. I’ve looked at tweaking the /blog/.htaccess file to do a 301 redirect. I’ve done so per this thread:

    http://wordpress.org/support/topic/99272?replies=8

    …and things work fine on the surface.

    However, MAJOR PROBLEM:

    The 301 redirect in the /blog/.htaccess file is now doing two significantly bad things to me:

    1. My themes aren’t found. i.e. going to http://example.com throws up the blog content, but no skin.

    2. I can’t get into the admin panel. i.e. going to http://example.com/blog/wp-login.php kicks me into another 404 situation, since the .htaccess is effectively redirecting me to the root, and wp-login.php doesn’t reside there.

    So to recap, there’s a conflict between:

    a) The idea of keeping WP core files in the old subdirectory below the root,

    and

    b) using a 301 redirect in the old subdirectory’s .htaccess file to redirect existing traffic to the new location at the root.

    Does this make sense? Seems so obvious, but I can’t seem to find anybody else who’s had this situation.

    I’m beginning to realize that perhaps I need to physically move my core files to the root, which makes me unable to take advantage of the abilitites described in the thread you mention.

    Thanks dude.

    So I slept on this and woke up realizing I need to choose between the lesser of two evils:

    1. Move my blog to the root while keeping my core files out of the way (in /blog), and find a way to live with the idea that all traffic directed from google (to my old links) will throw up a 404.

    2. Move all my core files from /blog to the root, live with the clutter, and set up the 301 redirect in /blog/.htaccess

    Neither of these sounds particularly appealing. Let me know if I’m overlooking a better option. Thx.

    Hmm, something occured to me.

    Since the /blog/.htaccess 301 redirect is conflicting with my ability to access the admin panel, perhaps I could create a second directory (such as /wp, for example). I then move my core files to /wp, keeping index.php and .htaccess in root. My wordpress addy would then be http://example.com/wp/, my blog addy would be http://example.com.

    The only purpose of the /blog directory would be to redirect existing traffic.

    Sound good? Handy?

    Ya know… that might actually be worth trying.

    I’ll admit that you’re wandering far afield from what I personally can answer authoritatively, but it sure sounds logical.

    OK, I think I’ve got it.

    To recap, I had a unique need. My blog resides at http://example.com/blog. I wanted to move my Blog Address to the root without cluttering up the root with files.

    The second part of my need was that I need to redirect existing Google traffic, which point to http://example.com/blog, to the new location in the root.

    The problem was that if I used a 301 redirect in the /blog/.htaccess file, my wp themes and admin wouldn’t be found, since the .htaccess was redirecting me to the root. A unique situation.

    The trick was to create a second subdirectory for the core files, and reserve the /blog directory for nothing more than the 301 direct. Here’s the riff:

    First, create a new folder /wp and copy everything into that. See this:

    http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

    Then copy the index.php and .htaccess to the root. Tweak the index.php file according to the instructions.

    Log in to the admin panel as instructed and change the Options accordingly to make http://example.com/wp the WordPress Address, and http://example.com the Blog Address.

    Now your core files are in /wp, and your Blog Addy is in root. But your old links to http://example.com/blog are throwing up a 404. You need a 301 Redirect in the /blog/.htaccess file. Use 4evrblu’s instructions here:

    http://wordpress.org/support/topic/99272?replies=12

    That should do it. You’ve now moved your Blog address out of /blog to the root, you’ve transferred your core files to /wp to avoid root clutter, and you’re redirecting existing traffic from /blog to the root. Dancing.

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    I see what it is you’re trying to do, and it might work… But frankly, I’d live with the “root clutter” instead, then just have a /blog/.htaccess redirecting everything.

    I’ve never liked the idea of separating where the root is from where the blog actually is. It makes things too complicated.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘301 redirect for /index.php/archive/’ is closed to new replies.