I am trying to install WordPress in a subdirectory. This is a new fresh install. Here is what I did:

Assuming my site is example.com, and I wanted to install wordpress in example.com/wordpress

A) I created a database on the server

B) I copied all wordpress directories to example.com/wordpress

C) I moved index.php from example.com/wordpress to example.com/

D) I modified the last line of index.php from:

require( dirname( __FILE__ ) . '/wp-blog-header.php' );

and it got modified into:

require( dirname( __FILE__ ) . '/wordpress/wp-blog-header.php' );

E) I modified wp-config.php and updated it in accordance with the required DB name, user name, password, and server name

Now, when I test hat locally, and when I go to example.com, I get redirected to the WordPress installation setup page. However, on the live server, I am redirected to http://www.example.com/wp-admin/install.php (notice the missing wordpress folder, the redirect should be to http://www.new-example.com/wordpress/wp-admin/install.php).

I have done this before, but not sure what is causing the problem. Can you please help? I really ran out of ideas. I tested everything I can think off (including typos), but to no avail. Please help.



Make sure you followed all these steps. It sounds like the .htaccess file was not updated correctly.

  • Thanks. I did that already. Also, there isn't .htaccess file yet, this is a fresh install and .htaccess gets created after using wordpress. I doubt this is the problem. – Greeso Jan 1 '14 at 19:16
  • So is http://www.example.com/wp-admin/install.php showing up as a 404 page since install.php is a subdirectory? – hornj Jan 1 '14 at 19:18
  • Yes, I get a file not found error. Becuse install.php is really located in http://www.example.com/wordpress/wp-admin/install.php – Greeso Jan 1 '14 at 19:22
  • I think talking to you helped me solve the problem. I got it to work. All I did is type the URL for installation. So, I typed http://www.example.com/wordpress/wp-admin/install.php and it worked. Thanks. :) – Greeso Jan 1 '14 at 19:26

You put this code in your subdirectry .htacces

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /newsite/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /newsite/index.php [L]
# END WordPress

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.