Wordpress hosted in a subdirectory (of a rails app) has the wp-admin url without the subdirectory -
the blog available @ http://www.example.com/blog
. login url accessible @ http://www.example.com/blog/wp-login.php
. once logged in, browser briefly shows http://www.example.com/blog/wp-admin/
in url field , redirects , shows dashboard @ url http://www.example.com/wp-admin/
.
the problem
now url in wordpress dashboard (eg: posts, pages, settings etc) of form http://www.example.com/wp-admin/xxx.php
instead of desired http://www.example.com/blog/wp-admin/xxx.php
. when click of these links, request goes rails app throws error doesn't know wp-admin
path.
i have set following in wordpress' wp-config.php
file:
define('wp_home','http://www.example.com/blog'); define('wp_siteurl','http://www.example.com/blog');
the apache conf file of rails app has reverse proxy setting:
proxypass /blog http://www.example.com:8080 proxypassreverse /blog http://www.example.com:8080
(yes, wordpress made listen in port)
this .htaccess
file have in wordpress root directory:
options +followsymlinks rewriteengine on <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule>
the confusion
i have little knowledge of how htaccess works. what's crazy is, based on app(rails+wp) that's working these exact same setup.
the difference between working , not-working apps(above) that, working site has no www
in root url in blog url. playing hand here?
any appreciated i'm struggling weeks.
i'd glad furnish more details if need them.
ps: there's no .htaccess
file in public folder of rails app. above mentioned htaccess file present @ wordpress folder's root location.
you need change database url - wordpress stores url in database in many places. check https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ example of how find/replace. otherwise can go database , change in wp_options table, might enough in. read on how change url: https://codex.wordpress.org/changing_the_site_url , try acting you're changing wrong 1 right one, , fix issue.
Comments
Post a Comment