In my root wordpress site running
I have the usual wp-content, wp-includes, wp-admin folders, but I also have my ‘drupal’ which is a drupal site
I have .htaccess file in both root and drupal directory
When i try to access any node of drupal website give page not found error of wordpress
Please a help me for that
Add
RewriteRule ^drupal - [L]
above the WP rules in the .htaccess that is located in the root.I have seen this a lot with Cpanel and Fantastico.
https://www.drupal.org/forum/support/post-installation/2010-08-09/installing-wordpress-in-a-sub-directory-of-drupal
The topic is old but still relevant. Just wanted to share my solution to this problem.
In WP, go to Admin > Settings > Permalinks;
Scroll down to the
bottom; You should see this:
If your .htaccess file were writable, we could do this automatically, but it isnât so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press Ctrl+a to select all.
Add this to WordPress
Open your .htaccess in the Drupal root dir, and find this bit:
Paste the WP Admin code underneath this, from “RewriteBase” to the end;
It should work now!
Make sure your WordPress permalinks are reset by hitting save ( the first URL here walks you through it
– https://www.cloudways.com/blog/fix-404-error-on-wordpress/
If that will not work try this.
See:
– I hope this is helpful cloudways.com will know the fix too.
Add this to WordPress
Ignoring Subfolders that exist in the DocumentRoot
With clean URL’s enabled, when running other software applications in subfolders (subdirectories) of a Drupal root installation. your .htaccess file may rewrite those URL’s to Drupal. This may be a particular problem for those with a Drupal installation in the root of their domain using Cpanel and Fantastico where Fantastico installs other software into subfolders. For example, phpSurveyor’s admin interface as installed by Fantastico will not work with Drupal’s default .htaccess settings. The URL for the admin interface is inaccessible and will return a “page not found” page in your Drupal site.
The trick is to modify .htaccess to ignore specific files/folders. So for example, if you have two folders, and in the root of your Drupal installation, modify your .htaccess file by inserting the following code directly after the “RewriteEngine on” directive, before the Drupal rewrites:
For each folder, you want to bypass, add a RewriteCond line, and end all but the final RewriteCond with [OR]. Note that the [L] in the rewrite rule tells it to stop there and bypass the rest of the rewrite rules.
Ignoring subfolders that are included via Apache Alias directives
As of 4.7, files and directories should be automatically allowed through in drupal’s .htaccess setup. Thats what the !-f and !-d lines do.
However if you are working with Apache Alias or similar directives the file doesn’t actually exist so drupal will take over like it should. The best way around it is to just add one more conditional that matches your location and make it skip it too. Thats what the ! means. Please see below:
It essentially means Apply this rule if the REQUEST_URI doesn’t start with /yourDirectoryName and the REQUEST_FILENAME isn’t a real file or a real folder. Which is exactly what you want. There is an implied “AND” between the lines of that rule. The ! says “not like this”.