Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
In the WP_CONTENT_DIR I have to give path to original wp-content folder? –  Priyam Dec 26 '11 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 –  Priyam Dec 27 '11 at 0:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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