WordPress.org

Ready to get started?Download WordPress

Forums

Moved Blog+Permalinks: What should my redirect look like? (11 posts)

  1. Jack
    Member
    Posted 8 years ago #

    I changed two things: I moved my wordpress files from a subdirectory to the root of my site, like this

    old: http://www.mydomain.com/weblog
    new: http://www.mydomain.com/

    and I started using permalinks instead of the ?p= or ?m=.

    What should my 301 redirect look like and where should I place it? In the first .htaccess (in the root, next to the wordpress files) or in a second .htaccess within the /weblog directory?

    And what about the cache folder?

  2. Jack
    Member
    Posted 8 years ago #

    Oh and another thing, in case the redirect doesn't work for permalinks:

    I just noticed that when I use:

    redirect 301 /weblog http://www.domain.com

    the redirect functions properly and all requests for /weblog including the ?p=301 are diverted, BUT all my images included in all the posts are in /weblog/archives... and none of the images is shown.

    Can I correct this or should I go back to putting WordPress back were it was in the beginning? (within /weblog)

  3. Jack
    Member
    Posted 8 years ago #

    Hmm, no one? Or perhaps my description is not accurate enough?

    In short:
    1. Can I use a 301 redirect on a folder but EXCLUDE some subfolders from that redirect (because of all the images inside those folders)?
    2. When using a redirect and simultaneously switching to permalinks instead of ?p=, will all my previous links be broken? (and therefore loosing my google pagerank?).

  4. splosh
    Member
    Posted 8 years ago #

    Silly question. did you move your images over?

  5. Jack
    Member
    Posted 8 years ago #

    All the images in my posts have have absolute links:
    http://www.mysite.com/weblog/images

    WordPress was also located inside /weblog.

    But now I moved the WordPress files to a seperate folder in the root, /wordpress, and only kept the index.php inside the root.
    So then I made a redirect from /weblog to the root. All the URL's of the images are still the same and they are printed correctly inside the sourcecode. But I guess that when the page calls for an image inside /weblog/images this call is also redirected to the root.

    Does that mean I should replace all the URL's inside my database?

    I'm asking all this because I read somewhere that it's best to have the first page of a website contain a lot of text instead of a first index.html with only <body onload=... > to the /weblog/index.php.

  6. splosh
    Member
    Posted 8 years ago #

    Are your wordpress files in root or in root/wordpress now?

  7. Jack
    Member
    Posted 8 years ago #

    /wordpress

    So I wanted it like this:

    index.php (the wordpress-file)
    /weblog (for all the images and static files)
    /wordpress (for all the rest of the wordpress files)

  8. splosh
    Member
    Posted 8 years ago #

    Is it possible you could just move all remaining /weblog folders into /wordpress and rename /wordpress to /weblog.? (then fix the rewrite and the blog settings?)

  9. Jack
    Member
    Posted 8 years ago #

    In that case I wouldn't need to move all the wordpress files into their own folder ;), I could just leave all the wordpress files and all the images and archives within /weblog. That was the old situation! :). But I would like to move just the wordpress 'index.php' file to the root of my site so it's accessible by domainname and I wouldn't need to make a redirect to /weblog anymore. But in this case I need to redirect all the old links I have in google from /weblog to http://www.mydomain.com. But there's the problem. Also the content of the subfolders within / weblog are redirected, resulting in empty space in my blo :(.
    When I make the redirect, accessing an old link (/weblog/?p=322) results in an empty page...

    I'm afraid I'm making a mess of this thread :). I'm sorry.
    Do you know what I'm trying to do now?

    Thanks for your efforts to understand...

  10. splosh
    Member
    Posted 8 years ago #

    last try:

    index is in root
    /wordpress has the blog files
    /weblog has the images and a redirect to index in root.

    put the images in a root/images folder(corresponding to the original path and where the redirect goes)

  11. Jack
    Member
    Posted 8 years ago #

    I'll try that later on during the day (have to get out for a moment ;) )

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic