Multisite setup help – plain domain/subsite always redirects to domain with subdir multisite

You’re close. I added a few more places to capture more scenarios and used the HTTP_HOST variable in the rule. The $1 is not needed in the condition as that would match what’s captured in the above condition. <IfModule mod_rewrite.c> RewriteEngine On Rewritecond %{HTTP_HOST} !^www\.(.*)$ [NC] RewriteCond %{REQUEST_URI} ^/subsite/? [NC] RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301] </IfModule> … Read more

get_query_var not working for subdirectory

You shouldn’t use get_query_var for getting the pagename (slug) – there is no guarantee that pagename will be set, depending on your permalink structure (or lack thereof). Instead, check if the request is for a page, and then get the slug directly from the queried object: if ( is_page() ) { $slug = get_queried_object()->post_name; }

Drawbacks to using Options -Indexes

There are some legitimate use cases for enabling Indexes but they’re probably not applicable to most sites (especially WordPress sites). For example Indexes are helpful on file storage mirrors where you want to provide readonly access to a subset of folders & files without having to build your own UI. As a best practice, yes, … Read more

Theme in wp-content but my index.php search theme files in root

I assume you are adding your stylesheets like this in your header: <link rel=”stylesheet” type=”text/css” href=”https://wordpress.stackexchange.com/questions/285785/css/style.css”> Which won’t work. To construct the path dynamically, you need to use the PHP functions offered for this. Make sure your header has <?php wp_head(); ?> in it, and then enqueue your style in your theme’s functions.php file as … Read more

Change directory of javascript files

go to your themes functions.php and find line 122. You will find navigation.js function. get_template_directory_uri() . ‘/js/navigation.js and change it to get_template_directory_uri() . ‘assets/js/navigation.js do it again for skip-link-focus-fix.js code located on line 124. For customizer go and find customizer.php in ‘inc’ folder. Go line 53 and change js/customizer.js code to assets/js/customizer.js Don’t forget to … Read more

WP install in sub-dir white screen

If WordPress is installed in the directory /dir1/dir2 and the corresponding .htaccess file is also in that subdirectory, ie. /dir1/dir2/.htaccess, then the .htaccess file should look something like: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On #RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [L] </IfModule> # END WordPress … Read more

How do you modify the WordPress directory structure?

Looking at your proposed structure, I am assuming that the only thing that would be changed is: The WordPress files are all kept in a folder you’ve called web. For this just create a .htaccess file in root folder, and put this content inside (just change example.com): <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?example.com$ RewriteCond … Read more

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