Support » Plugin: Redirection » redirect for url and url/ ?

  • Resolved Dantes100

    (@dantes100)


    Hello,

    This is probably a stupid question, but I couldn’t figure out how to redirect both URLs versions of one page:

    mypage1.com and mypage1.com/

    to

    mypage2.com/

    Thanks in advance,
    Eddie

Viewing 8 replies - 1 through 8 (of 8 total)
  • 1) cPanel redirect (if you got access for it)
    2) through .htaccess

    I’d like to achieve this with this “Redirection” plugin.

    Where is your WordPress installation and plugin?
    on mypage1 or on mypage2?

    Ah sorry, my fault. What I wanted to do was redirect:

    mypage.com/1 AND mypage.com/1/

    to

    mypage.com/2/

    I understand what you want to achieve, however, you need to share some technical information.

    Are both domains pointing to same WordPress installation? or to 2 different ones?

    That’s the point, it‘s the SAME domain, only two different pages.

    The problem is the slash, and no slash of the source url.

    • This reply was modified 7 months, 2 weeks ago by  Dantes100.

    In that case, let’s say that mypage2.com is your primary domain set in WordPress than when you type mypage1.com, WordPress will rewrite it to mypage2.com as he cannot hold 2 different domains.

    In that case, mysite1 shall be sorted and only what you need to sort is to redirect slugs into new domain if somebody is using them (or are indexed by Google). This shall be done through .htaccess file (this plugin can do that, you need to set the Group Apache in the plugin, so when you create redirect, you will choose group {name} related to apache module and this will to go .htaccess file).

    However, easier will be to just add below to your .htaccess file:

    Put on top of any other entries in that file.

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^mypage1.com [NC,OR]
    RewriteCond %{HTTP_HOST} ^www.mypage1.com [NC]
    RewriteRule ^(.*)$ http://mypage2.com/$1 [L,R=301,NC]
    Plugin Author John Godley

    (@johnny5)

    @dantes100 you will need to create two redirects, one for the URL with trailing slash, and one for the one without.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘redirect for url and url/ ?’ is closed to new replies.