Skip to content

Redirects through .htaccess on multisite #1340

Description

@idarek

Summary

By default, when using the plugin with Apache Groups in Wordpress Multisite to write redirects to .htaccess it create redirects that are applicable to all websites (URLs) rather than only to the main URL where the plugin is activated an in use.

<IfModule mod_rewrite.c> RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} RewriteRule ...

Actual Behavior

Will be nice if plugin detects a multisite environment and add to the rule RewriteCond to apply to specific WordPress domain rather than to all of them. Think it is HTTP_HOST.

Idea example:
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.fr$ [NC] RewriteRule ^(|fr)$ http://www.domain.com/fr/france [R=301,L]

And then under there will be RewriteRules as in plugin.

In that situation, Single .htaccess will be able to accommodate multiple instances of Apache redirect for different domains in a multisite environment.

Environment

Wordpress Multisite

References

https://wordpress.org/support/topic/redirects-through-htaccess-on-multisite/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions