HakeshDigital
-
Posts
9 -
Joined
-
Last visited
Posts posted by HakeshDigital
-
-
On 2/28/2024 at 8:52 AM, DV-JF said:
You should be able to do something like this:
This is awesome. Thanks for that contribution and many thanks to the module's author.
On 2/28/2024 at 6:57 PM, Tyssen said:Thanks @DV-JF that works great! 👍
Maybe you can add [SOLVED] to the post title.
-
After many many many fails, I've finally found a solution.
Now the .htaccess in the root folder of the Processwire installation contains this 🏆️ magic rule, in the first part of the 13c Section:
RedirectMatch 302 ^/(.*)(es|en|it|pt)$ /$1/$2/?lang=$2
Also, this can be set as a permanent redirect:
RedirectMatch 301 ^/(.*)(es|en|it|pt)$ /$1/$2/?lang=$2
-
10 hours ago, netcarver said:
Does it work if you remove, or comment out, the indicated line from your .htaccess file...
Hi @netcarver. Thanks for your interest. I am not using any of these lines. I shared them as an example of the multiple strategies I have already tested. Somehow doesn't matter what I do, something is happening inside PW. According to some browseo.com tests, the pages are doing multiple redirects:
Redirects found https://domain.tld/ ⇓ /es/www_domain_tld/ (301 Moved Permanently) [I use this page names on the apex domains so the subdomains can work.] ⇓ https://domain.tld/es/ (301 Moved Permanently)
---
https://domain.tld/es Response-Code 404 (Not Found)
I am having a serious SEO impact doubt to this problem. And I started this multisite as an SEO platform 😥 for hundreds of domains.
Another issue is when I share a homepage link on whatsapp... If I paste:
https://domain.tld/es/
Whatsapp is not able to retrieve the page metadata. I have to add a faux parameter to make it show the page title, image and description:
https://domain.tld/es/?foo
---
➜ HOW CAN I INSTALL THE ALTERNATIVE MULTISITE MODULE? 🙏🏼
Do you know how to make LanguageSupportPageNames::getPagePath() hookable, so I can migrate to the other Multisite module? I contacted @kixe without success.
According to this https://github.com/kixe/Multisite/blob/master/README.md, that module has everything I am looking for:🥳 Do not worry about page naming. The root page is defined via ID.
🥳 FULL multilanguage support
🥳 take in account $template->slashUrl settings
🥳 take in account LanguageSupportPageNames::useHomeSegment settings
🥳 Throws exception in case of misconfiguration
🥳 Access of pages residing inside a MultisitePageTree for other domains other than the corresponding domain is disallowed. (404)
🥳 Pages inside a MultisitePageTree accessible only via url based on the corresponding domain. 404 instead of unexpected redirects. [This is making some of my domains not to appear on Google]
Page paths are set via hook in Page::path() and LanguageSupportPageNames::getPagePath() instead of modifying the return of Page::render()
🥳 Crosslink support via the RTE (CK Editor) Link plugin. [I invented a "shortcodes" system to avoid this problem, but I'w prefer the standard methodology for my users]
🥳 Page view links in admin with correctly modified urls. For the branch related to calling domain only. [This is Awesome... My stats are all indicating /es/ /en/ and so on... I can not see wht domains are the most visited and the worst part is to undesrstand the thousands of error logs for 404 pages]Hope you or someone else can guide me on this. Thanks in advance.
-
Hello everybody. This is my first topic on the forum.
ProcessWire version 3.0.225
Multisite version 0.1.2I am using the @Soma's multisite module with multilanguage support (for 4 languages) and is working for my basic requirements. My default language is spanish and the root page (with home template) has the respective names for every language (es, en, it, pt). I am having trouble trying to make the trailing slashes to work for the main root parents (websites). My urls work as expected except in one situation:
https://domain.tld/es/ -> loads the spanish (default) page http://domain.tld -> redirects to the spanish (default) page https://domain.tld -> redirects to the spanish (default) page https://domain.tld/ -> redirects to the spanish (default) page https://domain.tld/es -> brings Error 404
If the url contains the language without trailing slash, it fails... Even when the template is configured to work only with trailing slash, and even defining different rules in the root's folder .htaccess without effect.
RewriteCond %{REQUEST_URI} ^(.*)/([a-z]{2})$ RewriteRule ^(.*/)(es|en|it|pt)$ $1$2/ [R=301,L]
RewriteRule ^(.*/)es$ ^(.*/)es/ [R=301]
RewriteCond %{REQUEST_FILENAME} !-f RewriteRule (.+(?:es|en|it|pt))$ /$1/ [L,R=301]
RewriteCond %{REQUEST_URI} ^/([a-z]{2})/ RewriteRule ^ - [E=LANG:%1] RewriteCond %{ENV:LANG} !^$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ /$1/ [L,R=301]
Can anybody be so kind to explain me what to do with this issue? Thanks in advance.
PS: I tried to migrate to @kixe multisite module but couldn't make hookable the LanguageSupportPageNames::getPagePath(). I still don't know how to achieve such task. Maybe wih this module I could solve the issue, according to the readme file.
-
Thanks for your efforts, gentlemen.
-
On 8/7/2022 at 3:50 PM, Kiwi Chris said:
@kixe Your fork of the module doesn't allow issue reports on Github, so I'll mention it here.
There is a hook into AdminRestrictBranch module if present to automatically restrict the page tree to the root of the domain in multisite mode.
if ($this->wire('modules')->isInstalled('AdminRestrictBranch')) { if (method_exists('AdminRestrictBranch', '___getBranchRootParentId')) { $this->addHookAfter('AdminRestrictBranch::getBranchRootParentId', function ($e) { $e->return = $this->rootPageID; }); } else $this->warning('AdminRestrictBranch::getBranchRootParentId() is not hookable'); }
Where this has an issue is that if a user is only supposed to have access to page tree belonging to domain A as defined in AdminRestrictBranch, and then logs in to domain B, the branch restriction defined in their user profile or role is overridden by the hook in multisite. This means if any user knows other domains under the same installation of ProcessWire using Multisite, they can log in and access the page tree of those domains, even if AdminRestrictBranch is configured to otherwise prevent them from accessing them.
A quick fix is to comment out the hook code.
A better fix would be to check whether a user or role already has branch restrictions in place defined by AdminRestrictBranch, and if so, defer to those restrictions, but if not, provide default behaviour as exists of restricting to the root of the domain.
Hi @Kiwi Chris. Can you please tell me how to make the @kixemodule to work? How to make the language hookable?
-
On 1/15/2024 at 11:54 AM, nexuspolaris said:
Web -Regions -Search -Registration --regiosite ---About us ---FAQ ---404 --origosite ---About us ---FAQ ---404
I think you must not use the home page as a website.
The way this works for me is like this:
Home -RootDomain --Regions --Search --Registration --404 -regiosite --About us --FAQ -origosite --About us --FAQ
Also like this, having a 404 page for each site:
Home -RootDomain --Regions --Search --Registration --404 -regiosite --About us --FAQ --404 -origosite --About us --FAQ --404
-
Hello everybody. This is my first time on the forum.
I am using the @Soma's multisite module with multilanguage support (for 4 languages) and is working for my basic requirements. My default language is spanish and the root page (with home template) has the respective names for every language (es, en, it, pt). I am having trouble trying to make the trailing slashes to work for the main root parents (websites). My urls work as expected except in one situation:
https://domain.tld/es/ -> loads the spanish (default) page http://domain.tld -> redirects to the spanish (default) page https://domain.tld -> redirects to the spanish (default) page https://domain.tld/ -> redirects to the spanish (default) page https://domain.tld/es -> brings Error 404
If the url contains the language without trailing slash, it fails... Even when the template is configured to work only with trailing slash and even defining different rules in the root's folder .htaccess without effect.
RewriteCond %{REQUEST_URI} ^(.*)/([a-z]{2})$ RewriteRule ^(.*/)(es|en|it|pt)$ $1$2/ [R=301,L]
RewriteRule ^(.*/)es$ ^(.*/)es/ [R=301]
RewriteCond %{REQUEST_FILENAME} !-f RewriteRule (.+(?:es|en|it|pt))$ /$1/ [L,R=301]
RewriteCond %{REQUEST_URI} ^/([a-z]{2})/ RewriteRule ^ - [E=LANG:%1] RewriteCond %{ENV:LANG} !^$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ /$1/ [L,R=301]
Can anybody be so kind to explain me what to do with this issue? Thanks in advance.
I tried to migrate to @kixe multisite module but couldn't make hookable the LanguageSupportPageNames::getPagePath(). I still don't know how to achieve such task.
ProcessWire version 3.0.225
Multisite version 0.1.2
[SOLVED] Problem with trailing slash on domain's home pages in a multilanguage and multisite installation (using Soma's Module)
in General Support
Posted
That rule was in conflict with native admin urls so I had to change it and use this way:
Hope this help someone else in the near future.