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
  • 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, 2012 at 13:46

1 Answer 1


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');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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