• Resolved mattkiosk

    (@mattkiosk)


    I am using v3.4.4 of the plugin installed on a sub-folder multisite install of WP 4.3.1. The plugin is configured to Pre-Path mode and is giving me a bit of trouble in terms of URL setup.

    In order for links to be as SEO-friendly as possible, the language URL segment needs to come right after the host in a URL. On the “root” site of the multisite, this is how all the links are generated, for example: http://www.site.com/it/subfolder1. Clicking this link, however, throws a 404. If I hack the URL to read http://www.site.com/subfolder1/it everything loads properly and all links on that subfolder site are generated correctly. But that leads me to my second issue.

    Outside of the “root” site, all subfolder sites fail to generate URLs to their siblings. This appears to be the result of how the qtranxf_complete_url_info function inspects the “home” site against any URL (it doesn’t compare hosts). As a result, all the links at http://www.site.com/subfolder1/it to any other subfolder site do not have the language URL segment included.

    I’ve forked the GitHub repo and start hacking on the code to resolve this issue. I’ve been able to get the URLs to build properly (language segment immediately after host, sibling subfolder links correctly including language segment), but the links themselves won’t load, instead throwing a 404. I suspect it’s something in how the plugin or WordPress is attempting to load the path. It seems like it’s including the language segment as part of the request rather than ignoring it.

    I’m hoping someone has had similar trouble or can point me in the right direction in the code so I can patch it. Any insight or guidance would be appreciated, especially considering the $urlinfo/$url_info hash as I suspect the gap in my knowledge surrounding that is hindering me the most. In the meantime, I’ll keep hacking and reading the source.

    Thanks in advance for any help!

    https://ww.wp.xz.cn/plugins/qtranslate-x/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author John Clause

    (@johnclause)

    What do you have in “WordPress Address (URL)” and “Site Address (URL)” on page “/wp-admin/options-general.php”?

    Language code ‘/it/’ comes after whatever is in “Site Address (URL)” and .htaccess has to be consistent with it: https://codex.ww.wp.xz.cn/Giving_WordPress_Its_Own_Directory.

    I hope this may help.

    Thread Starter mattkiosk

    (@mattkiosk)

    Excellent. Thank you for the help. It does answer my question. Unfortunately, it seems as though my problem is a bit wonkier than I expected.

    Great work on the plugin, too. It does an amazing job.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Trouble with Sub-Folder Multisite’ is closed to new replies.