Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

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

with

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

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

Thanks!

# 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]
</IfModule>
# 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. –  m0r7if3r Jan 29 '12 at 13:46
add comment

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]
</IfModule>

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
add comment

Your Answer

 
discard

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.