• Resolved Irene

    (@arlinaite)


    Hi,

    I had uploaded your plugin in the hope of solving the following issues:

    1) I have a multisite install for one site.
    The main site redirects as follows:
    example.com => example.com/es
    and the other subsite is example.com/en
    The redirections are in the htaccess file, and they work fine, except for one detail.

    It is as follows:
    I moved from html site to wp 8 years ago. First I put the redirections for each page, but when I arrived to my current hosting they told me that I must clean up the htaccess file from so many redirects.

    They told me to put the following:

    # Main Redirect
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^mysite\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.mysite\.com$
    RewriteRule ^/?$ "https\:\/\/mysite\.com\/es\/" [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^mysite\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.mysite\.com$
    RewriteRule ^index\.html$ "https\:\/\/mysite\.com\/es\/" [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^mysite\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.mysite\.com$
    RewriteRule ^indexingles\.html$ "https\:\/\/mysite\.com\/en\/" [R=301,L]

    The problem I have is that although I uploaded sitemaps.xml the bots keep scrolling the old links, and they are redirected to the homepage example.com/es which now has become an important issue.

    I imported the htaccess file in the hope that I will understand what to change, so the traffic of missing pages htm and html pages can go to the 404 page. And eventually rescue some of them to redirect them properly. Sorry but I don’t understand what to change. The site is live and I don’t want to break the redirections.

    Can you tell me please what I have to change in the actual redirect?
    Thanks in advance.

    • This topic was modified 3 years, 10 months ago by Irene.

    The page I need help with: [log in to see the link]

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

    (@johnny5)

    I don’t understand the question. What part of Redirection isn’t working?

    Thread Starter Irene

    (@arlinaite)

    Hi John

    The redirect works fine except for the following issue

    1)This is the issue
    Example: of a non-existent page
    https://mysite.com/music/argentina_tango/tango_music.htm

    redirects to homepage
    https://mysite.com/es/

    instead to get a 404 error.

    If the bad request don’t have the /es/ or /en/ following the domain, is redirected to the main page which in my site is:
    https://mysite.com/es/

    2) The other question is if I import the main redirects from the htaccess file into the plugin, all the other redirects will be stored in the htaccess file or I can avoid this?

    Thanks in advance

    • This reply was modified 3 years, 10 months ago by Irene.
    Plugin Author John Godley

    (@johnny5)

    Sorry, I’m still not sure I understand.

    Have you created a redirect for https://mysite.com/music/argentina_tango/tango_music.htm ? Is it working?

    What is a bad request?

    Are you asking if the plugin uses the .htaccess file? Unless you configure it to do so, then no it doesn’t.

    Thread Starter Irene

    (@arlinaite)

    Hi,

    No, I didn’t setup a specific redirection for this page, this just an example page. https://mysite.com/music/argentina_tango/tango_music.htm
    https://mysite.com/non-existent-page
    https://mysite.com/whatever

    However its redirected by the main redirect which is in the access file.
    The redirection is as follows:

    # Main Redirect
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^mysite\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.mysite\.com$
    RewriteRule ^/?$ "https\:\/\/mysite\.com\/es\/" [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^mysite\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.mysite\.com$
    RewriteRule ^index\.html$ "https\:\/\/mysite\.com\/es\/" [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^mysite\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.mysite\.com$
    RewriteRule ^indexingles\.html$ "https\:\/\/mysite\.com\/en\/" [R=301,L]

    Is perfect that mysite.com/ redirects => mysite.com/es
    Is perfect that index.html redirects => mysite.com/es
    Is perfect that indexingles.html redirects => mysite.com/en

    What is wrong:
    Some part of this main redirect is causing that every non-existing page inside mysite.com (This site is empty) is redirected to the main page which is in the subdomain mysite.com/es/ instead of getting a 404 error.

    Summarizing

    Every URL that has mysite.com/non-existen-page redirects to the main page: mysite.com/es/. This is a very bad thing. I have to change this and I don’t know how.

    If the URL is mysite.com/es/non-existen-page it gets a 404 error which is ok.

    If the URL is mysite.com/en/non-existen-page it gets a 404 error which is ok.

    Thread Starter Irene

    (@arlinaite)

    Your plugin is amazing! The logs are working and now I can see what’s going on! This is exactly what I need, I am grateful!
    I am redirecting some files to the proper pages and its working fine.

    I expect that you could help me with the ones that must get a 404 error instead to be redirected to the home page

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Need of advice’ is closed to new replies.