• viebone

    (@viebone)


    Hello,

    I have mysite.com and mysite.com/en, but if I login into the admin, the url of the second blog change to mysite.com.

    I don’t know what is going on.

    Any clue of what can I do or what could be happening????

    Thanks!

Viewing 15 replies - 1 through 15 (of 22 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    What’s in your .htaccess?

    Thread Starter viebone

    (@viebone)

    Hello,

    Thanks for your help, I am completely desperate.

    If I am honest I don’t know what I am doing exactly with this .htaccess.

    Thanks

    # canonical redirect to no www
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
    
    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    
    # END WordPress
    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    For a quick test, remove the canonical redirect you have for www.

    Thread Starter viebone

    (@viebone)

    Hello,

    I have removed the canonical redirect and at the moment it is working good.

    I made some test, changed a few post and all seems to work fine.

    Do you think this was the problem??? What a canonical www redirect means???

    Thank you so much for your help!

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    The canonical redirect forces your domain to use domain.com instead of https://www.domain.com

    The problem was that you wrote it wrong. If you want to use that, it should be this:

    RewriteCond %{HTTP_HOST} ^www\.domain\.tld$ [NC]
    RewriteRule ^(.*)$ https://domain.tld/$1 [R=301,L]

    The way you wildcarded it breaks on WP due to it’s rules.

    Thread Starter viebone

    (@viebone)

    Hi,

    Today it happened again, The url of the second blog have changed and now both have the same url.

    It’s to weird no??? I removed the canonical redirection as you told me but it’s happening again.

    if I go to mydomain.com or https://www.mydomain.com I can see the website and I removed the canonical redirection.

    What should I do????

    Thanks you very much!

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Are you being redirected to one URL or the other, or are BOTH working?

    Thread Starter viebone

    (@viebone)

    Both are working, if I point my browser to mydomain.com/en the site its working but if I go to the admin > mysites, both are redirecting to mydomain.com

    If I force in the browser mydomain.com/en/wp-admin, I can access to the second blog admin.

    The only think that is changing it’s the field siteurl of the table wp_3_options in my data base.

    In this row of the db, the url have to be https://www.mydomain.com/en, but sometimes, wordpress remove the /en and leave https://www.mydomain.com

    It is a problem because I am using the fuction site_url() in my theme to get content depending on the language, and when wordpress change the url and remove the /en the website throws a few errors.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    By ‘working’ do you mean https://www.domain.com/en works AND domain.com/en works, or only one?

    See, WordPress needs to be one or the other. Having both is problematic.

    Thread Starter viebone

    (@viebone)

    If you go to https://mysite.com/en or https://www.mysite.com/en you get the same page and no errors, you can see the page.

    What I can not understand it’s why wordpress change the url in the data base.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Okay, so both www and non-www works. Amd that’s a problem.

    You should only use ONE. One should redirect to the other. So domain.com/en should magically redirect to https://www.domain.com/en (or vice versa, it depends which you used when you setup the site).

    What I can not understand it’s why wordpress change the url in the data base.

    Sorry what? Did you change something in the DB?

    Thread Starter viebone

    (@viebone)

    Well my main problem is that wordpress, not me, automatically change the url of my second blog in the database.

    I have to blogs: myblog.com and myblog.com/en

    well, I don’t know why but when I login into the admin wordpress changes the url of the secondo blog to myblog.com, removing the /en string at the end.

    Each time it happens I go to the database, find the table wp_options of the secondo blog and I see that the field siteurl was changed to mydomain.com. If I want my blog work again I have to go to my database and change it be my self.

    I don’t know what its happening

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Well my main problem is that wordpress, not me, automatically change the url of my second blog in the database.

    No. WordPress will not do this. A plugin might, or you may have done it on accident, but WP doesn’t magically flip that over for you. You have something else on your site doing that.

    What plugins are you running?

    Thread Starter viebone

    (@viebone)

    Hello again, thanks you so much for your help.

    It happens each time I use the admin to create new post, update content etc. After updating I always have to enter in the database and change the siteurl of the table wp_3_options, which is the second blog options table, and add the “/en” to mydomain.com

    I am using the following plugins:

    – Advanced Post Types Order (https://www.nsp-code.com/)

    – Lightbox Plus

    – Search Everything

    – User Role Editor (https://shinephp.com/user-role-editor-wordpress-plugin/)

    I think all of them are common plugins.

    This weekend I will deactivating them just for to be sure.

    What do you think could be happening.

    Thanks!

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    I think there’s something in your theme or your plugins that’s doing this.

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Url problem / wp_3_options table change’ is closed to new replies.