Forums

Hiding wp-content folder in URL with mod_rewrite (3 posts)

  1. FenyX
    Member
    Posted 1 year ago #

    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:
    http://www.mydomain.com/wp-content/anything/anyfile.php should appear as
    http://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?

  2. FenyX
    Member
    Posted 1 year ago #

    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/[^/]+/(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]

    Please help

  3. FenyX
    Member
    Posted 1 year ago #

    Note:

    even on WP.org forums

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

Topic Closed

This topic has been closed to new replies.

About this Topic