• Hello, I am trying to do a 301 redirect in my htaccess but the page I’m redirecting is also a slug, so I’m having redirection issues. Is there a way to specifically only redirect a certain page without affecting anything else? This is what I’ve tried:

    Redirect 301 /question/ https://website.com/support/

    In other URLs the slug is used this way: https://website.com/question/test-question/

    So the 301 redirection breaks that path. Thank you in advance for any advice on this.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Try Redirect 301 /question/$ https://website.com/support/

    see https://wpengine.com/support/regex/

    Thread Starter shemakeswebsites

    (@shemakeswebsites)

    Hi Steven,

    Thanks for the quick reply and suggestions. In theory, this should work…but nothing is happening on the front end. Using this doesn’t do any redirection at all.

    Do you know if perhaps this is something my host needs to allow(regex).

    Dion

    (@diondesigns)

    The Redirect directive will not work. See: https://httpd.apache.org/docs/2.4/mod/mod_alias.html#redirect

    Try using a rewrite rule, perhaps something like the following:

    RewriteEngine On
    RewriteRule ^/question/$ https://website.com/support/ [R=301,L]

    There is no need for a <IfModule> conditional since you are already using rewrite rules. But make sure this rule appears before the WordPress rewrite block!

    Thread Starter shemakeswebsites

    (@shemakeswebsites)

    That worked! Thank you so much, I appreciate it.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @shemakeswebsites Please do not make new topics for the same thing. Also do not use Developing with WordPress for these types of topics. Use Fixing WordPress, this is not a Developing with WordPress topic. I have archived your new topic.

    If you still have redirection problems them please un-resolve your topic here in the right sidebar.

    Thread Starter shemakeswebsites

    (@shemakeswebsites)

    Thanks Jan – the redirection question was not related to this post. This matter was resolved. Can you please unarchive and set in Fixing WordPress? I will ask my questions there next time.

    Thank you.

    Thread Starter shemakeswebsites

    (@shemakeswebsites)

    @jdembowski Hello it’s me again. I’m not sure if I need to create a new post for the one that you archived, because now it’s not accessible so no one will respond to it. I would like the copy so that I can recreate it the Fixing WordPress forum.

    As stated, the one that you archived was for a different matter and should have been just moved over – not archived. Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘301 Redirect Help’ is closed to new replies.