Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all,
Vanilla are planning an update to the site on April 24th (next Wednesday). It is a major PHP8 update which is expected to boost performance across the site. The site will be down from 7pm and it is expected to take about an hour to complete. We appreciate your patience during the update.
Thanks all.

.htaccess Redirect?

  • 07-07-2014 11:36am
    #1
    Moderators, Technology & Internet Moderators Posts: 4,621 Mod ✭✭✭✭


    Say I develop a WordPress site and at the moment there is a redirect from domain.com/ to domain.com/site. I want to move the site to the root directory /. This isn't a problem.

    However, a lot of pages would have been linked directly to posts which if would show a 404 error.

    How to a redirect all pages/links on /site to / so if I was to browse to /site/about it would redirect to /about, and if I was to browse to /site/projects it would redirect to /projects, without having to list them manually?

    I could list them manually but I seem to remember some method of doing the above without manually listing them?

    Thanks in advance


Comments

  • Registered Users Posts: 7,739 ✭✭✭mneylon




  • Registered Users Posts: 6,487 ✭✭✭daymobrew


    Or you could change the links via WP Migrate DB. It involves exporting a .sql file with the corrected site data and then importing it, overwriting the existing database. Do backups before importing.

    If the development site is at domain.com/site there should not be incoming links (but a .htaccess could handle that).


  • Registered Users Posts: 10,660 ✭✭✭✭maccored


    or change the main site url in the database from domain.com/ to domain.com/site


  • Registered Users Posts: 63 ✭✭ThrowinShapes


    You could have a look at:
    coolestguidesontheplanet.com/redirecting-a-web-folder-directory-to-another-in-htaccess/

    What you're looking for is this:
    RewriteRule ^subdirectory/(.*)$ /$1 [R=301,NC,L]

    Just replace subdirectory with the subdirectory name of the old site.


  • Moderators, Technology & Internet Moderators Posts: 4,621 Mod ✭✭✭✭Mr. G


    You could have a look at:
    coolestguidesontheplanet.com/redirecting-a-web-folder-directory-to-another-in-htaccess/

    What you're looking for is this:
    RewriteRule ^subdirectory/(.*)$ /$1 [R=301,NC,L]

    Just replace subdirectory with the subdirectory name of the old site.

    That's what I was trying to find. Thanks!


  • Advertisement
Advertisement