I have moved a wordpress installation to a subdirectory, from var/www/html
to var/www/html/wp-blog
mainly to make it future proof. I have followed the instructions in the codex. My server is configured as such
blog.mysite
to the port 8080..htaccess
from what is given in the codex and it is as follows.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^blog.mysite$
RewriteCond %{REQUEST_URI} !^/wp-blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /wp-blog/$1
RewriteCond %{HTTP_HOST} ^blog.mysite$
RewriteRule ^(/)?$ wp-blog/index.php [L]
</IfModule>
I have only changed the ^(www.)?
test to blog
since I don't want www
. Also although the wordpress instance is in a subfolder I would like to server it via blog.mysite
and the admin at blog.mysite/wp-admin
.
Now my trouble is that when I use the the url blog.mysite/wp-admin
it takes me a the login page but I get stuck in a loop after that. I noticed that my url in the address bar has a redirect_to
set at blog.mysite/wp-blog/wp-admin
. If I remove wp-blog
from the redirect url, I am able to login.
The weird part is that, if the session gets over while I am in the admin page, the redirect url is fine!
At this point I have changed the Wordpress URL
in the General Settings to blog.mysite/wp-blog
and everything works as far as I see. But as I said before I would like to use the admin panel on the root.
I have moved a wordpress installation to a subdirectory, from var/www/html
to var/www/html/wp-blog
mainly to make it future proof. I have followed the instructions in the codex. My server is configured as such
blog.mysite.com
to the port 8080..htaccess
from what is given in the codex and it is as follows.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^blog.mysite.com$
RewriteCond %{REQUEST_URI} !^/wp-blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /wp-blog/$1
RewriteCond %{HTTP_HOST} ^blog.mysite.com$
RewriteRule ^(/)?$ wp-blog/index.php [L]
</IfModule>
I have only changed the ^(www.)?
test to blog
since I don't want www
. Also although the wordpress instance is in a subfolder I would like to server it via blog.mysite.com
and the admin at blog.mysite.com/wp-admin
.
Now my trouble is that when I use the the url blog.mysite.com/wp-admin
it takes me a the login page but I get stuck in a loop after that. I noticed that my url in the address bar has a redirect_to
set at blog.mysite.com/wp-blog/wp-admin
. If I remove wp-blog
from the redirect url, I am able to login.
The weird part is that, if the session gets over while I am in the admin page, the redirect url is fine!
At this point I have changed the Wordpress URL
in the General Settings to blog.mysite.com/wp-blog
and everything works as far as I see. But as I said before I would like to use the admin panel on the root.
Check the two URLs in the wp-options table of your database. One is for the 'regular' URL, and one is used to build the 'admin' URL.
Both should be just your domain, as in https://www.example.com .