User Tag List

Results 1 to 3 of 3

Thread: Website 301 redirect help

  1. #1
    Join Date
    Jun 2008
    Location
    Berkeley
    Posts
    1,053
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Website 301 redirect help

    I'm trying to redirect specific pages and subdirectories from one domain's website to another domain. Both sites use Wordpress. I have some experience doing this via .htaccess and a redirect plugin, but am running into a few challenges and could use some guidance.

    Some of my redirects work as intended -- e.g., from one specific old page right off the root directory to the corresponding specific page on the new site.

    Other redirects are not working because the old URL does not have an exact match on the new site and as a result I get a 404 error on the new site. I can't figure out how to redirect a specific page from the old site to a catch-all subdirectory on the new site.

    For example, on the old site I have this file structure:

    /product/
    /product/features/
    /product/benefits/

    On the new site I only have this:

    /newproduct/

    I'm able to redirect /product/ to /newproduct/ successfully, but can't redirect the specific features and benefits pages to /newproduct/ because the old URLs are carried over to the new site, which does not have corresponding pages. So I get 404 errors.

    I suspect there is a way to address this via Rewrite commands in the .htaccess file, but that's where my experience drops off.

    If any of you can give me a clue I'd appreciate it.

  2. #2
    Join Date
    Mar 2017
    Location
    The Paris of Appalachia
    Posts
    31
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Website 301 redirect help

    If you want to redirect all of the paths under /product to the /newproduct page you'd do something like this:

    RewriteEngine on
    RewriteRule "^/?product(.*)$" "/newproduct" [L,R=301]

    If you want to preserve the page structure but change the parent directory it would look like

    RewriteEngine on
    RewriteRule "^/?product(.*)$" "/newproduct$1" [L,R=301]

    Check out https://htaccess.madewithlove.com to play around with this until you get what you want.

  3. #3
    Join Date
    Jun 2008
    Location
    Berkeley
    Posts
    1,053
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Website 301 redirect help

    Thanks, I’ll check it out! Since my original post, I found a Wordpress plugin called Redirection that helps non-coders like me write regular expressions. But I’m still learning.

Similar Threads

  1. New website
    By datas_brother in forum The Frame Forum@VSalon
    Replies: 4
    Last Post: 07-25-2012, 10:13 AM
  2. new website is go
    By cicli polito in forum The Frame Forum@VSalon
    Replies: 14
    Last Post: 04-30-2009, 05:06 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •