Home › Forums › WordPress Plugins › Hide My WP › Redirect WordPress upload folder . content?
- This topic has 10 replies, 2 voices, and was last updated 5 years, 10 months ago by
Suman M..
-
AuthorPosts
-
June 21, 2019 at 10:38 am #26606
Hi,
I changed my upload path from /wp-content/uploads/ to /file/.
I would like to create a 301 redirect for all my image files.
I created this rewrite rule: “RewriteRule ^/wp-content/uploads/(.*)$ /file/$1 [R=301,NC,L]” but when I do this, all my image redirects include a query parameter showing my admin link key.
What is the right rewrite rule to do this and not have conflicts with your plugin? (attached is a screenshot with an example)
Thanks
Attachments:
You must be logged in to view attached files.June 23, 2019 at 7:12 am #26613Hi, can you please let us know why you would like to create such 301 redirects? Please post here your site’s htaccess content (after adding HMWP rewrite rules and the above redirect). Also let us know your webiste url. Thanks!
Note: you may post as private reply.
June 23, 2019 at 8:55 am #26622This reply has been marked as private.June 24, 2019 at 4:28 am #26631Hi, I checked the redirect and unfortunately it won’t work without HMWP query string in that case because of the way HMWP handles redirects of default WP paths.
I noticed that “/wp-admin” and “/wp-json” are visible in scripts in the source code. How can I hide this? (on my other sites, I don’t see this for some reason).
>> You’ll need to rename wp-admin path name in HMWP Permalinks & URLs tab. (Please follow the steps carefully)
>> For wp-json, set “API Base” and “API Query” in Permalinks & URLs tabJune 24, 2019 at 12:07 pm #26653Hi,
Ok, that’s really annoying as I think that the reasoning behind wanting to redirect makes sense.
Is there a risk that other redirects be affected? Like page or other non default WP folders?Thanks for taking the time.
June 25, 2019 at 7:41 am #26673Hi, we understand your concern. We’ll see what can be done here in the upcoming versions.
Other redirects won’t be affected, except for the URLs with these paths – https://www.screencast.com/t/N0zZlmYouk0jJune 25, 2019 at 8:52 am #26675This reply has been marked as private.June 25, 2019 at 9:15 am #26677So, I figured out that the issue is renaming the API base.
What is the best practice to both remove /wp-json/ and keep CF7 working?
Thanks
June 25, 2019 at 5:53 pm #26685Is your CF7 form making any API call? Otherwise this should not have been the issue. It’s working fine in our test sites with CF7.
June 26, 2019 at 9:24 am #26705I think that it does to validate Ajax submissions.
Either way, as soon as I restore the default API name, forms start working just fine again.
The closest thread I’ve found so far was https://wordpress.org/support/topic/contact-form-7-wp-json-404-error/ .June 27, 2019 at 9:23 am #26719Okay, we recommend you not to rename API Base and API Query if it’s conflicting with your CF7.
-
AuthorPosts
You must be logged in to reply to this topic.