Rewriting Rule for redirecting start page only
-
Hi, my purpose is: If a user enters exactly “https://subdomain.maindomain.com/” he must be redirected via 301 to “https://maindomain.com/”. But for alle other pages (such as https://subdomain.maindomain.com/magazine etc.) he must not be redirected, but stay on the entered url.
For all common providers I would just add the line “RewriteRule ^$ https://maindomain.com [R=301,L]” in the htaccess file, but as the website is hosted on wordpress.com and they don′t provide htaccess I can′t do that and would like to use the redirect plugin for that.
But how do I configure this properly? I set up “^$” as Source URL (and activated “Regex”) and “https://maindomain.com [R=301,L]” as target url. I also tried using “https://maindomain.com” only, but both solutions wouldn′t work.
Can you or anyone help me? Thanks a lot!
- The topic ‘Rewriting Rule for redirecting start page only’ is closed to new replies.