• Resolved Irene

    (@arlinaite)


    Please, could some body help me?
    I have WPMU with apache server, with subfolder site for the language, /es/ is the main site, main language. I more or less finish /es/ then I have to duplicate or clone the site to make /en/ translation, an have to build some others sites with related topics, all in subfolders.
    I need this kind of redirect:
    https://www.example.com->example.com->example.com/es/
    I am using this some body gave me, and it works but…

    # BEGIN redirect
    RewriteEngine on
    Options +FollowSymlinks -MultiViews
    RewriteCond %{HTTP_HOST} ^(www\.)?ejemplo.com\.com$ [NC]
    RewriteRule ^$ https://ejemplo.com/es/ [R=301,L]
    RewriteCond %{HTTP_HOST} ^www\.ejemplo\.com$ [NC]
    RewriteRule ^$ https://ejemplo.com/es/ [R=301,L]
    
    #I also using this kind of redirect
    Redirect 301 /index.html https://example.com/es/

    … but may be is causing this error I see in the error log:

    [Sat May 23 16:43:27 2015] [error] [client 77.247.181.163] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary.

    Thanks in advance.

Viewing 8 replies - 1 through 8 (of 8 total)
  • https://www.example.com -> example.com

    This part I would do in dns. Exactly how depends on what already is there.

    example.com -> example.com/es/

    In later versions of WordPress Multisite I believe this part you can do by setting /es/ to be the main site.

    Another option: Don’t even use multisite or wpmu and instead use plugin polylang for multiple language translations of a single site.

    Thread Starter Irene

    (@arlinaite)

    santeven,
    Thank’s for your advise.
    Is not a multilingual site.
    Is bilingual, and the translation is for only a part of the main language, site.
    I put the main language in subfolder because is better not to clone the first site in multisite net. And cloning the site saves a lot of time.
    I have to build several sites related to the main site and they are not translation, that is why I use multisite.
    About the DNS part I think, may be I’m wrong, you could access the site with the two domains, with and with out www, and this becomes a duplicate site for SEO.
    About
    example.com -> example.com/es/
    I,m using last version wpms and I don’t see a simple way to achieve what I’m looking for with site alive.
    Every thing works fine, and I have a minor error in htaccess file, maybe some body could help.
    Thank’s again

    Thread Starter Irene

    (@arlinaite)

    I discover that the redirection in my htaccess is not a minor error.
    It works properly in browser but when I test it with:

    https://www.webconfs.com/redirect-check.php
    Either https://example.com is NOT REDIRECTING to any URL or the redirect is NOT SEARCH ENGINE FRIENDLY

    https://web-sniffer.net/
    Shows the empty index.php of the central website that is in the root.

    I also have done question in Webmaster Central Help Forum and expert unswear:
    ” No, don’t tinker with index.php if using WP and multi-site.
    Probably best not to tinker with the .htaccess files either.

    I cannot help because my one-time experience with WP multi-site was very bad and so hard to control that I didn’t use it in the end.

    It may be that the /es/ folder is a figment of WP multi-side installation. It likely does not actually exist in the physical structure of the hosting account.”

    A big part of site is up and running. But couldn’t loos traffic with a ” NOT SEARCH ENGINE FRIENDLY ” solution. Is any body there that capable to help?

    ” No, don’t tinker with index.php if using WP and multi-site.
    Probably best not to tinker with the .htaccess files either.

    I would say the same advice.

    It may be that the /es/ folder is a figment of WP multi-side installation. It likely does not actually exist in the physical structure of the hosting account.”

    Yes that is exactly the case! It is handled by the .htaccess and that’s why you shouldn’t tinker there

    But couldn’t loos traffic with a ” NOT SEARCH ENGINE FRIENDLY ” solution. Is any body there that capable to help?

    Isn’t the not search engine friendly problem only a result of your tinkering in .htaccess?

    Have you tried reverting to the original unmodified .htaccess ? and doing the first part redirect as I suggested in DNS ? and then try to figure out if and how to do the second part ?

    I would put the “Redirect 301 /index.html https://example.com/es/” at the top of the .htaccess file.

    Not vetting the rest of your rewrite rules, but try this:

    RewriteEngine on
    Redirect 301 /index.html https://example.com/es/
    
    # BEGIN redirect
    RewriteEngine on
    Options +FollowSymlinks -MultiViews
    RewriteCond %{HTTP_HOST} ^(www\.)?ejemplo.com\.com$ [NC]
    RewriteRule ^$ https://ejemplo.com/es/ [R=301,L]
    RewriteCond %{HTTP_HOST} ^www\.ejemplo\.com$ [NC]
    RewriteRule ^$ https://ejemplo.com/es/ [R=301,L]

    Of course:

    ‘example.com’ needs to be the actual domain…(as does ejemplo)

    Espero que esto ayude

    Thread Starter Irene

    (@arlinaite)

    Gracias por tu colaboración.
    I appreciate your concern. But doesn’t work as should.
    If you type the address example.com in the browser you access the site, example.com/es/ as I wish, exactly as it was with the first code.
    But if you use https://web-sniffer.net/ or other htaccess check tools:
    Shows the empty index.php of the central website that is in the root.

    Thread Starter Irene

    (@arlinaite)

    Pioneer Valley Web Design,
    Muy oportuno tu comentario, agregue tambien la redirección del index.php y funcionó!!
    I ad the redirect for index.php on the top of the htaccess and appears to be fine now.
    It looks like this:
    # BEGIN redirect index
    RewriteEngine on
    Redirect 301 /index.html https://example.com/es/
    Redirect 301 /index.php https://example.com/es/
    # BEGIN redirect /es/
    RewriteEngine on
    Options +FollowSymlinks -MultiViews
    RewriteCond %{HTTP_HOST} ^(www\.)?example.com\.com$ [NC]
    RewriteRule ^$ https://example.com/es/ [R=301,L]
    RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
    RewriteRule ^$ https://example.com/es/ [R=301,L]

    htaccess test tools:
    Found redirect to https://example.com/es/. The Redirect is Search Engine Friendly.

    Thank’s to all comments. Is pending the behaviour of the error log to see if there is redundancy

    Thread Starter Irene

    (@arlinaite)

    One more thing more:
    I took out the index.php redirect.
    It cause an browser error: too many redirects.
    I move back the index redirect to its place.
    And I upload an index.html to the server.
    As its the first choice to look, no need to redirect index.php
    by now every thing is fine
    Code is exactly as in the beginning of the thread.

    # BEGIN redirect /es/
    RewriteEngine on
    Options +FollowSymlinks -MultiViews
    RewriteCond %{HTTP_HOST} ^(www\.)?example.com\.com$ [NC]
    RewriteRule ^$ https://example.com/es/ [R=301,L]
    RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
    RewriteRule ^$ https://example.com/es/ [R=301,L]
    # BEGIN redirect index
    RewriteEngine on
    Redirect 301 /index.html https://example.com/es/

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘htaccess redirect with multisite’ is closed to new replies.