• I’ve read so much forums and articles about how to do this. But while the question is always the same, the answer is always different and sometimes not reliable at all, even on WP.org forums. For example some peoples advice to add the following lines in .htaccess code:

    RewriteEngine on
    RewriteRule ^/wp-content/(.*) /$1

    But as I’m not an expert of using regular expressions or Apache modules, I can’t know the value of such an answer. That’s why I would like some help to reach my goal.

    I’ld like to change the URLs on my blogs as follow:
    https://www.mydomain.com/wp-content/anything/anyfile.php should appear as
    https://www.mydomain.com/anything/anyfile.php

    And if I find the right way to do it, do you think it could cause problems with plugins, uploaded files or anything located in the wp-content sub-directories?

    Edit: or is it safer to rename the folder as explained HERE?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter FenyX

    (@fenyx)

    Another tech has shared this lines to add to .htaccess but I’m still not sure if it’s or not the right method:

    RewriteCond %{THE_REQUEST} ^[A-Z]+\s/wp-content/
    RewriteRule ^wp-content/[^/]+/(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

    Please help

    Thread Starter FenyX

    (@fenyx)

    Note:

    even on WP.org forums

    Because some peoples are advising here to use crap plugins to do that redirection

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hiding wp-content folder in URL with mod_rewrite’ is closed to new replies.