Wordpress Default Directory Change - wordpress

I am trying to change the default path of the WP default directories such as wp-content, wp-include etc to avoid wpscan.
I have tried using plugin would it possible to perform the same using manual techniques. I am using apache as a web server.
An example, I have tried:
RewriteRule ^cms_plugins/(.+) /wordpress/wp-content/plugins/$1 [L,QSA]
Thanks

Try the following steps to rename WP-Content Folder
Download the WP-Config.php file
Open and Edit the Wp-Config.php file to add the below line
define( 'WP_CONTENT_FOLDERNAME', ‘new_directry_name’ );
Change 'new_directory_name' to the name you want for your content folder.
Upload WP-Config.php file back to your server
Follow these steps to replace the WP_Content folder
Download WP-Config.php file
Open and add the below lines
define( 'WP_CONTENT_DIR', ‘new_directry_local_path’ );
define( 'WP_CONTENT_URL', 'http://new_directry_url' );
Change new_directory_local_path and http://new_directory_url to your local path and URL.
Upload back to your server

Related

Wordpress Internal server 500

I have a wordpress site in my local environment, then I transferred it on clients server then I encountered internal server error, when I changed language using q-translate plugin but in my local environment it is working.
I have tried:
wp-config - add memory
php.ini - put in root directory with
memoey_limit 2048M
Try This,
WPLANG defines the name of the language translation (.mo) file. WP_LANG_DIR defines what directory the WPLANG .mo file resides. If WP_LANG_DIR is not defined WordPress looks first to wp-content/languages and then wp-includes/languages for the .mo defined by WPLANG file.
define( 'WPLANG', 'de_DE' );
define( 'WP_LANG_DIR', dirname(FILE) . '/wordpress/languages' );
double check .htaccess file, something wrong with ur htaccess. I had this kind of problem so normally i checked and replace .htaccess from local env to new one.

How to redirect wordpress (installed inner directory) to main root address?

I've installed wordpress into a inner directory. like root/mysite . Why I didn't install it on root because there are so many addon domain installed, and I literally don't want to mess all addon domain folders with wordpress files inside root directory. My root directory is for www.example.com . And my wordpress site I've installed on root/mysite, so the url for that is www.example.com/mysites . Is there anyway to redirect www.example.com/mysites to www.example.com . As I said the only reason for not installing wordpress on my root, because I don't want to mess wordpress files, folders with other addon domain's folders on root.
So my main goal is showing a wordpress site on www.jimfahad.com that is installed on www.example.com/mysites. Is there any way?
Yes, you can leave the WordPress install and folders in mysites, but you have to copy the .htaccessfile and the index.php file to root. This will result in the visual URL of WordPress being in root (example.com), but the uploads, theme URLs, etc, being in example.com/mysites.
See the WordPress Codex > Giving WordPress Its Own Directory « Using a pre-existing subdirectory install on how to copy and edit the files:
1) Go to the General settings panel.
2) In the box for Site address (URL): change the address to the root
directory's URL. Example: http://example.com
3) Click Save Changes. (Do not worry about the error message and do
not try to see your blog at this point! You will probably get a
message about file not found.)
4) Copy (NOT MOVE!) the index.php and .htaccess files from the
WordPress (wordpress in our example) directory into the root directory
of your site—the latter is probably named something like www or
public_html. The .htaccess file is invisible, so you may have to set
your FTP client to show hidden files. If you are not using pretty
permalinks, then you may not have a .htaccess file. If you are running
WordPress on a Windows (IIS) server and are using pretty permalinks,
you'll have a web.config rather than a .htaccess file in your
WordPress directory.
5) Edit your root directory's index.php:
6) Open your root directory's index.php file in a text editor. Change
the line that says:
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
to the following, using your directory name for the WordPress core
files:
require( dirname( __FILE__ ) . '/wordpress/wp-blog-header.php' );
and save the file.
7) Login to your site (if you aren't still already). The URL should
still be http://example.com/wordpress/wp-admin/
8) If you have set up Permalinks, go to the Permalinks panel and
update your Permalink structure. WordPress will automatically update
your .htaccess file if it has the appropriate file permissions. If
WordPress can't write to your .htaccess file, it will display the new
rewrite rules to you, which you should manually copy into your
.htaccess file (in the same directory as the main index.php file.)

Change upload directory in WordPress

Can anyone tell me about how to change upload directory without touching wp-config.php in WordPress?
You need to go in wp-config.php and and set upload path:
define( 'UPLOADS', 'wp-content/'.'files' );
If you want the upload directory outside of wp-content you need to set upload path in wp-config.php like this:
define( 'UPLOADS', ''.'files' );
For same issue i used this manual link
Hope it will be helpful for you
let's say you upload a picture. After you upload it, you can view the file at something like:
example.org/wp-content/uploads/2014/12/picture.png
And let's say you now change the uploads folder location via:
Now you need to change in wp-config.php
define('UPLOADS', 'wp-content/media');
This will give you a URL like this:
example.org/wp-content/media/2014/12/picture.png
Hope this will help!

Moving wp-content folder to Amazon S3/CloudFront?

I would like to move my wp-content folder to Amazon S3/CloudFront.
I copied the folder to an S3 bucket.
I am in the process of editing the wp-config.php file in order to tell it where to find the moved wp-content folder.
But I am unable to find out which URL to link to?
Do I link to S3 or to CloudFront?
And where do I find the link that I need to enter into wp-config.php?
In order to store the files on S3, you will need to change both the directory location and the URL WordPress renders.
You will need a tool that can map S3 as a local mapped network drive. Check out FUSE or TNT Drive. Create a new network drive mapped to S3 using one of these tools.
Include these lines anywhere above the line where WordPress includes the wp-settings.php. Inside your wp-config.php file:
define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/Mapped/S3Folder/ToBucket/wp-content' );
define( 'WP_CONTENT_URL', 'http://www.domain.com/blog/path/to/wp-content' );

wordpress change themes location

Usually all the wordpress themes are uploaded and saved over the server say http://example.com/wp-content/themes/ . I am developing a plug-in to change this path to something like http://xyz.com/themeFolder/ . So i have to develop such a functionality where my wordpress installation will be on one server and the themes and plug-ins folders will be on another server.
Any help, will be highly appreciated.
Thanks in advance to all the genius people out there :)
Since Version 2.6, you can move the wp-content directory, which holds your themes, plugins, and uploads, outside of the WordPress application directory.
Set WP_CONTENT_DIR to the full local path of this directory (no trailing slash), e.g.
define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/blog/wp-content' );
Set WP_CONTENT_URL to the full URI of this directory (no trailing slash), e.g.
define( 'WP_CONTENT_URL', 'http://example/blog/wp-content');
SOURCE
Do not forget to check THIS page as well.

Resources