• I used to have my wordpress as a section of an html site – and recently relocated WordPress back to the root so the whole site is now WordPress. And I changed the blog listing page from /blog/ to /blogs/ (With an extra S)

    What it means is that blog posts used to be /blog and are now /blogs, and search results are coming back as failures.
    How can I forward all visitors to a link containing /blog/ to the new directory /blogs/?
    For example

    https://www.lavenhamphotographic.co.uk/blog/180818-jade-nick-coach-house-at-marks-hall-wedding-photography/
    Fails, however, stick an ‘s’ in and it works:
    https://www.lavenhamphotographic.co.uk/blogs/180818-jade-nick-coach-house-at-marks-hall-wedding-photography/
    And remove the folder all together
    https://www.lavenhamphotographic.co.uk/180818-jade-nick-coach-house-at-marks-hall-wedding-photography/
    Works too

    I installed a forwarding plugin, but I can’t get it to forward all visitors to the blogs folder, I can only input exact links to be forwarded (And there’d be 194 links to put in!

    I’ve done a Ryte website analysis and it’s saying 194 broken links, though I’m not sure where it’s finding them listed! The xml sitemap actually lists all the blog entries with no /blog/ or /blogs/ folder at all.

    Just to be sure nobody is following an old link, how to I forward all visitors to /blog/* to /blogs/*?

    Thanks

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • If you’re on an Apache server, you can do it with a RewriteRule in your site’s .htaccess file. I’m not an expert, but I think you would use something like this:

    
    RewriteEngine On
    RewriteRule ^blog/(.*) https://www.lavenhamphotographic.co.uk/blogs/$1 [L,NC,R=301]
    

    What that’s doing is taking any URL with “blog/” in it and redirecting it to the root of your site, prepending “blogs/” and including anything that follows “blog/” as the “$1” after that.

    Note that you only have to have one “RewriteEngine On” in the file, as long as your rules follow it, and your server must have mod_rewrite installed and running. If you’re on another type of server, I’m sure there are redirects for it, as well.

Viewing 1 replies (of 1 total)
  • The topic ‘Best way to forward (Changed Blog Directory)’ is closed to new replies.