• Resolved arnlig3550

    (@arnlig3550)


    Hello

    I am looking for which method to use for a redirect problem.
    To explain, I had a site “www.domain.fr” + a subdomain “subdomain.domain.fr”. This weekend I deleted the subdomain “subdomain.domaine.fr” because I no longer need it. So I just have “www.domain.fr”.
    The problem is that google had indexed the pages of the subdomain. So I would like to redirect all pages in the subdomain to a specific page in the domain.
    I tried :

    Source URL: https://subdomain.domain.fr/(.*)
    Target URL: https://subdomain.domain.fr/specific-page

    and it is written:

    “This will be converted to server redirect for the domain subdomain.domain.fr.
    To avoid greedy regular expressions, you can use ^ to anchor it to the beginning of the URL. For example: ^ https: //subdomain.domain.fr/ (. *) ”

    Server redirect, is this good for me?
    I added the “^” at the beginning as indicated, did I do it right?

    Thank you ! ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author John Godley

    (@johnny5)

    No, ^https://subdomain.domain.fr/(. *) is not correct. If you are using a ‘URL and server’ you should enter the domain in the domain field, and the /(.*) in the source field.

    Thread Starter arnlig3550

    (@arnlig3550)

    Hello

    Thank you for your reponse

    Is this code good? Because it not works

    Source URL: ^/(.*) Regex yes
    Corresponding: URL and Server
    Server: https://subdomain.domain.fr
    When it matches: redirect to a URL with HTTP code 301
    Matching target: https://www.domain.fr/page

    Thanks

    Plugin Author John Godley

    (@johnny5)

    Have you cleared all of your caches? I can’t test the URL myself as it’s not valid.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘redirect all pages in the subdomain to the domain’ is closed to new replies.