WordPress Multisite and how to apply sef urls only to specific sites

I have a WordPress Multisite installation with its main url set to

https://web.mydomain.com

(there are some nginx proxies behind this url which I can't manage)

Most of the sites are generated as

https://web.mydomain.com/site1

https://web.mydomain.com/site2

https://web.mydomain.com/site3

One of the sites has a special url set (masked in one of nginx proxies) as: https://specialname.mydomain.com (which internally -i guess- redirects to https://web.mydomain.com/site1 without user noticing that)

I've already edited site's settings in WP Site Manager to reflect this url and works

Siteurl: https://specialname.mydomain.com

Home: https://specialname.mydomain.com

Multisite already has an .htaccess file set for sef-urls which is working, but:

If I enable (in Permalink settings) the entry-name (or other) option https://specialname.mydomain.com/example-page/ all the links (including home) give 404

Is there any way to make sef-urls work for this specific site redirection in .htaccess?

Here's actual .htaccess code:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
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).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

Thanks a lot for any tip you can give me about this

Topic subdomains domain-mapping htaccess multisite Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.