Custom location for attached images

I would try changing your line in wp-config.php to define( ‘UPLOADS’, ‘media/blog/files’ ); // where docker is mounted Ie, get rid of the first /. Let me know if this works. EDIT If you can’t change the definition of UPLOADS you could strip out the forward slash out with code. Try changing your code to … Read more

Access files at new location using old file paths

I believe I’ve found the solution. I add the following RewriteRule ^example_directory/files/(.*) new_directory/$1 to my WordPress .htaccess rules like so: RewriteEngine On RewriteBase / RewriteRule ^example_directory/files/(.*) new_directory/$1 RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] I couldn’t get it working before and I think the key was moving the … Read more

more than one upload directory?

Using a stock WordPress installation, no. WordPress, by default, stores uploads in the /wp-content/uploads/yyyy/mm/ directory for single sites. For network installations, it stores them elsewhere and maps a similar permalink structure to the new location. I can see what you’re trying to accomplish by keeping things in separate directories, but you’d have to revise a … Read more

Multiple wp-config.php files in one home directory

Use one main wp-config.php and name the others according to the name of the host: example.com.config.php example.net.config.php and so on. In your main wp-config.php write: $current_config = __DIR__ . “https://wordpress.stackexchange.com/” . $_SERVER[‘HTTP_HOST’] . ‘.config.php’; if ( file_exists( $current_config ) ) require_once $current_config;

Accessing site’s root from themes folder

I guess you’re talking about a site specific wp-config.php file that resides in your themes folder. At the point where you’re loading the wp-config.php file, WP isn’t fully loaded, so you ain’t got any constants or filesystem API or other basic API functions available. Here’s how I approach this: Structure # Dir structure ~/ROOT ├── … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)