Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

204
Views
Wordpress in subfolder insists on showing the parent directory's contents

I'm attempting to migrate our wordpress blog from blog.ourdomain.co.uk to ourdomain.co.uk/journal, but ourdomain.co.uk/journal always shows the content from ourdomain.co.uk/.

To keep the migration simple, I started with a blank wordpress install in /journal, then imported 'All Content' using WP's built in export/import features.

All seemed well at first, but when I visit ourdomain.co.uk/journal it does not show a wordpress home page, but instead the home page of our main site. Even visiting ourdomain.co.uk/journal/index.php results in this behaviour. This site issues a 301 to redirect to ourdomain.co.uk/journal, and then I see the main site homepage rather than wordpress.

I can't see anything in the parent directory .htaccess file which would make this happen. The wordpress .htaccess file contains the code as per below, most of which was auto-created by wordpress, but I added the wp-admin redirect rule.

I can visit and use https://www.ourdomain.co.uk/journal/wp-admin/ no problem. Database cxn is OK. I can also visit static files such as https://www.ourdomain.co.uk/journal/readme.html. Links direct to posts also work fine, such as https://www.ourdomain.co.uk/journal/2021/post-title-here/ - it's just the homepage.

Even if I set the home page to be a static page, such as our about page in wordpress, this still happens.

I have defined define('WP_HOME', 'https://www.ourdomain.co.uk/journal'); and define('WP_SITEURL', 'https://www.ourdomain.co.uk/journal'); in wp-config.php

If I delete the contents of the /journal .htaccess file, then I am able to load https://www.ourdomain.co.uk/journal ONCE, then it goes wrong again because wordpress has rewritten the rewrite code to .htaccess - so clearly this is something to do with permalinks, but I'm unable to figure out what, exactly, the deal is.

Any help gratefully received.

Contents of .htaccess:

# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /journal/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /journal/index.php [L]
</IfModule>

# END WordPress

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^wp-admin\/?$ wp-admin/index.php [NC]
</IfModule>
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

OK, has worked for 24 hours now so: fixed by adding 'DirectoryIndex index.php' to .htaccess. Looks like redirection was just going up the folder tree until it found a directory index page it recognised, so making it recognise the one in /journal fixed it.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!