Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirects through .htaccess on multisite #1340

Open
idarek opened this issue Dec 9, 2018 · 4 comments
Open

Redirects through .htaccess on multisite #1340

idarek opened this issue Dec 9, 2018 · 4 comments

Comments

@idarek
Copy link

idarek commented Dec 9, 2018

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/

@timloden
Copy link

timloden commented Apr 4, 2019

Just ran into this issue as well and would love to see this feature.

@idarek
Copy link
Author

idarek commented Apr 4, 2019 via email

@jg314
Copy link

jg314 commented Nov 13, 2019

We also ran into this issue. We'd love to use .htaccess for redirects on multisite, but we need them to only apply to the website where they were created.

@SPNilsen
Copy link

I am currently facing this issue. I can work with .htaccess directly but it would far easier to expand the capability of the plugin to accept a regex or full url. Even being able to select from a dropdown of sites as the base or the redirect URL would be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants