: How to add an exception to this rewrite rule I need to change this so that one file in wp-admin is not forced through https: # add a trailing slash to /wp-admin RewriteCond %{REQUEST_URI} ^.*/wp-admin$
I need to change this so that one file in wp-admin is not forced through https:
# add a trailing slash to /wp-admin
RewriteCond %{REQUEST_URI} ^.*/wp-admin$
RewriteRule ^(.+)$ %{SERVER_NAME}// [R=301,L]
This forces all requests to /wp-admin through SSL but it is breaking a wordpress plugin which needs to access wp-admin/admin-ajax.php.
Is there a way to adjust the rule so that it will allow non encrypted requests to that one file?
thanks!
More posts by @Rivera981
2 Comments
Sorted by latest first Latest Oldest Best
Add an additional condition before your rule that does the redirect to https:
RewriteCond %{REQUEST_URI} !=/wp-admin/admin-ajax.php
Which will prevent the rewrite/redirect from occuring for this file
Have not tested it, but this should do it...
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
Redirect /directory/file.html domain.com/directory/file.html
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.