Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress Subdirectory giving 404

I am trying to copy the root WP installation to a sub directory. (I changed the permalinks in the new copy database to the subdirectory links)

The subdirectory will be root/b2b/

When I try to reach the subdirectory I get redirected to a 404 page.

This is the .htaccess in the root

# 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>

In the subdirectory I currently have no .htaccess since everything that I tried is not working.

I checked the other topics but none of them seems to work for me.

like image 415
Albert Avatar asked May 05 '26 01:05

Albert


2 Answers

Replace following line

RewriteRule . /index.php [L]

to

RewriteRule . /b2b/index.php [L]

and

RewriteBase /

to

RewriteBase /b2b/
like image 70
Bhumi Shah Avatar answered May 07 '26 15:05

Bhumi Shah


You can change the RewriteBase

RewriteBase b2b
like image 32
dobriy_santa Avatar answered May 07 '26 15:05

dobriy_santa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!