WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed Wordpress in a subdirectory '/medical' and want the address to show up as www.mysite.com/page not www.mysite.com/medical/page

The Wordpress Codex here : https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory says to replace




but that line does not appear in the generated .htaccess file.

I've tried just inserting the line before the /ifmodule tag but it breaks the site...


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /medical/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /medical/index.php [L]
# END WordPress
share|improve this question
Do you have the wordpress url and site url set in Settings->General? Also, are you changing the require() in .htacceess, or index.php? It should be index.php, as stated in the link you posted. – mor7ifer Jan 29 '12 at 13:46

use ths constants for set the install and main domain of WP

define('WP_SITEURL', 'http://www.example.com');
define('WP_HOME', 'http://www.example.com/blog');

i think the htaccess is fine:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]

the index.php in the root has only an require to the file of the install: require('./wordpress/wp-blog-header.php');

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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