0

Here is what I am thinking of trying to hide wp-content from the urls of files included in page source.

defining the following in wp-settings.php

define ('WP_CONTENT_URL','http://example.com/myownfoldername');

and adding this to .htaccess

RewriteRule ^myownfoldername/(.*) /wp-content/$1 [QSA,L]

This seems to work fine with no additional plugins on localhost `but will it work seamlessly on the online site with a few plugins. I am more concerned about w3 total cache.

I guess I need now worry about a few reference of wp-content in database as even if it exists there it is still a valid link?

2 Answers 2

4

You don’t need a separate rule in your .htaccess. Add …

define( 'WP_CONTENT_DIR', 'YOUR_LOCAL_PATH' );
define( 'WP_CONTENT_URL', 'YOUR_PUBLIC_PATH' );

… to your wp-config.php. Do not write into wp-settings.php. This file will be overwritten during the next update – never touch a core file.

2
  • In the WP_CONTENT_DIR I have to give path to original wp-content folder?
    – PRYM
    Commented Dec 26, 2011 at 23:58
  • Using WP_CONTENT_DIR, I have to rename the folder to the new directory name. But using .htaccess I can still have directory name as wp-content
    – PRYM
    Commented Dec 27, 2011 at 0:05
-1

NO NEED TO HIDE!

You will waste energy. it has no secruity. Read this - https://goo.gl/Pkq8Kn

1
  • while I agree, this is a comment and not an answer Commented Jul 8, 2016 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.