Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

endpoint, EP_MASK ? WPML + multisite : in URL, change the place of lang (en, fr, nl ...) WordPress

  • REFUNDED

Hi,

I use WP multisite and WPML.
The URL of a post in a subsite is like that :
http://mysite.com/subsite1/en/post1

but I want this structure of permalink :
http://mysite.com/en/subsite1/post1

is it possible ? And how please ?


EDIT : more information.... There is a main site. There is several sub-sites : subsite 1, subsite 2, subsite 3, subsite 4 etc...
and each site use WPML. So for each site I need to have
http://mainsite.com/lang/subsite1/.../post1

For the moment I have
http://mainsite.com/subsite1/lang/.../post1

lang (fr, nl, en ... for example) is not at the good place for me.

Answers (3)

2018-01-15

Bob answers:

are you trying to create subsite for each language?


Sébastien | French WordpressDesigner comments:

I don't understand what you suggest... Could you precise ?

2018-01-15

Cesar Contreras answers:

The structure of your multi-site installation is "http://mysite.com/subsite1/" that's why it is displayed in this way "http: //mysite.com/subsite1/en/ ...."

the other option you have is to show them as subdomain "http: //subsite1.mysite.com/en/ ..."


Sébastien | French WordpressDesigner comments:

thank you but it's a very basic information....

2018-01-15

MDan answers:

Did you setup your WPML project already? If not, you have a full tutorial here, directly from WPML:
This is per your example (different domains).
https://wpml.org/2016/04/use-wpml-different-domains-per-language/

ADD OR DELETE DOMAINS AND DOMAIN ALIASES IN PLESK:
https://mediatemple.net/community/products/dv/204404344/add-or-delete-domains-and-domain-aliases-in-plesk

If you want to set the network under subdomains:
https://wpml.org/documentation/support/multisite-support/multilingual-site-network-with-domain-mapping/

For custom URL rewriting, here is a sample solution:
https://wordpress.stackexchange.com/questions/289122/wpml-language-switcher-for-custom-rewrite-rules
https://wpml.org/forums/topic/custom-url-rewrite-rules-messing-with-wpmls-ones/

And further help here:
https://ghumkumar.com/wpml-url-override-on-archive-page/
https://www.kirstencassidy.com/multisite-and-the-dreaded-blog-slug-base/

icl_ls_languages filter is the key here.


Sébastien | French WordpressDesigner comments:

I think you have not understand my question.

each subsite is un english and un french.

what i need is to deplace "en" and "fr" in the url


Sébastien | French WordpressDesigner comments:

what I need : change the position of "en" or "fr" in each url of each subsite.


MDan comments:

Please check this topic, it's a
https://wpml.org/forums/topic/sadf/

You could also try with this plugin:
https://en-gb.wordpress.org/plugins/permalink-manager/

Altough I don't think that kind of URL structure can be set with WPML, it will interfere with the multisite evironment.
For this kind of question, I think it would be best if you could discuss directly with the support team at WPML, so you will know for sure if it is or isn't feasible to achieve what you want.