Currently my htaccess file contains this rule, to redirect website.org/index.php to website.org/en/home
RewriteRule index.php /en/home [R=301]
However, currently also other index.php
pages in deeper folders redirect! e.g. website.org/folder/index.php
redirects to website.org/en/home
How can I have that rule exclusively apply to the root, and no deeper folders? Thanks very much.
htaccess rewrite rules can be used to direct requests for one subdirectory to a different location, such as an alternative subdirectory or even the domain root. In this example, requests to http://mydomain.com/folder1/ will be automatically redirected to http://mydomain.com/folder2/.
E.g.: RewriteCond %{HTTPS} off RewriteCond %{HTTP_HOST} ^www.example.com/$ [NC] RewriteRule ^(. *)$ http://www.example.com [R=301,L] ... @BobbyS I used the solution in this article. It redirects www and HTTP to non-www HTTPS and also handles the trailing / .
RewriteRule ^index.php /en/home [R=301]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With