Pregunta

My Main site displays (mypage.com/site) and all following pages include /site as well How do I achieve (mypage.com) and no subdirectory displaying?

I have tried Removing the /site in the Site Address URL in Wordpress settings. But it broke my login and disables me from logging in.

what must I do to remove the /site subdirectory folder dislaying on my website?

What do I do in my htaccess file?

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

# END WordPress
¿Fue útil?

Solución

I supposed that your WordPress installation is under /site folder. If it's true, you can do it:

If you already has changed the URL, on General panel, to http://mypage.com (without /site), you just need to copy the index.php (under site/) to the root folder.

After copy the index.php file, edit it, adding site/ to the path to wp-blog-header.php:

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

The detailed steps of this process are on "Using a pre-existing subdirectory install " at WordPress docs: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

Otros consejos

Have you tried to change your document root in Apache?

Something like:

DocumentRoot /path/to/your/site

I don't know if you have access to your hosting, but this would be the best solution as far as I know.

If you can't do it for yourself, you can ask to your hosting provider to do it for you.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top