Admin bar doesn't appear on the front-end of a WordPress website - wordpress

I have a WordPress installation in a subdomain (http://base.example.com), but I want users to access the front-end from (http://www.example.com). The subdomain is a subfolder within the root of the site. I have copied index.php and .htaccess to the root of my site and changed the path in index.php to point to my subdomain. The website works fine, both the front-end and back-end, but when I login and go to the front-end, I cannot see the admin bar, and it appears as if I am logged out. When I go to wp-admin, I see the admin bar, and I can preform all administration functions as needed. How do I fix this problem so I can see the admin bar on the front-end?

EDIT 2:
You should be able to resolve your issues using the plugin root Cookie. It hasn't been updated in 2 years, but it will fix the problem that you're having. You need the login/authentication cookie to be accessible across subdomains. Follow these directions:
Install and activate the plugin.
Enable subdomain support in plugin settings.
Logout of the WordPress admin.
Login again and check if it works.
The reason that this issue occurs is because when WordPress sets the cookie that says you're logged in, it sets it for the administration domain. That means, when you visit from the non-administration domain, the cookie isn't allowed to be used for authentication due to browser security. This plugin changes the URL for the cookie to allow for use across subdomains, which allows for you to see the admin bar on the front-end.

Related

wordpress network plugins page prompts login

I am experiencing very weird behavior from my wordpress website.
My network section of the website keeps redirecting me to a login page that i cannot login with my administrator user of the website.
However when i use the url of the network pages like dashboard or plugins i see the same login page which this time i can actually login with my administrator user.
to clarify this:
lets say i have example.com/wp-admin/network/plugins.php
if i manually type this in the url section i get a login page which my admin user logs in no problem
if i use the link in the wordpress dashboard to access the same plugins page of my network drop down i get a login page that doesn't accept my admin user.
now in this situation my question is
1- Should the wordpress prompt login each time i want to access my network section. How can i cancel this?
2- Why are the links for the network section not working.
My guess is that the www.example.com and example.com for the network and one of the websites are not redirecting right.
Please Guide Me.
UPDATE:
I'm afraid that I was unable to find the origin of the issue.
I have performed various tests that you can double-check below.
* I have deactivated all plugins for the entire Multisite network.
* Deactivated the SSL Force feature of Let's Encrypt tool.
* Tested by opening the website directly from the server in order to bypass CloudFlare servers.
* Restored the theme from a backup and reverted that modification after the test.
* Tested with different browsers(Chrome, Mozilla, Safari)
* Configured the correct Rewrite directives for the Multisite application defined in the .htaccess file as the old ones were for a regular single-site application.
* Tested different PHP versions.
* Confirmed that all WordPress core files are not modified or customized.
* Activated a default WordPress theme for the tests, and reverted to the default one after that.
After the mentioned tests, I would suppose that the issue is caused by a conflict in the database records.

Can a NonWordpress Page on a Wordpress Based Site Cause Issues with Permalinks

I have a website built with Wordpress that has been having permalink issues. A few days ago, I had added a simple file, named qr.php, that I dropped in at the root level (where the wp-content and wp-upload folders reside). It has a script that redirect to pages outside of my website depending on what type of device the user is using. Basically, some one on a Apple device gets redirected to an itunes page, and droid user to the droid app store, etc.
Could this non Wordpress page be causing issues? I have had static or html pages in amonst my root level files before, and never had an issue. I feel like the redirects may change this.
Rather than using the qr.php(cutom redirect file) in your wordpress site. You can use a plugin which will help to redirect the external links.
Some of the plugins which might help you to achieve your purpose are Device Redirect - WordPress Phone &Tablet Redirect , RedirectPlus - Wordpress Mobile Redirect Plugin.
See the screenshots, try demo and check whether it fits your requirement.
No, it dont cause any issue with permalink..
I am also using a wordpress website : abc.com and a php based software integrated to admin folder on root.. And I can access easily abc.com and abc.com/newfolder/abc.php

Wordpress Multisite - user registration stuck in wp-login loop

I'm having trouble registering users on a Wordpress multisite. I can't seem to access the register screen, either from the main site, or from a sub-site. Clicking 'Register' just sends the user back to the Login screen.
The site is currently set up with two domains (a .org and a .org.uk), using the Domain Mapping plugin. The following options are set within the Domain Mapping plugin:
Remote Login
Permanent redirect (better for your blogger's pagerank)
User domain mapping page
Redirect administration pages to site's original domain (remote login disabled if this redirect is disabled)
Each sub-site is set to allow user registrations, and the network settings allow the follow option: 'User accounts may be registered.'
Interestingly, the site also runs Woocommerce, and users can register accounts from within this plugin.
Any help would be greatly appreciated.
Thanks,
David

Wordpress Setting Custom URLs for login. Not Possible?

I am not an expert for mod_rewrite, so I need a big time help. Here is the scenario:
Domain Name: www.example.com
Points To: /www/public_html/
I have a wordpress installation at:
/www/public_html/subfolder/
Now I have two htaccess files, lets call them .h1 and .h2 . I have managed upto now to do this:
When user types www.example.com they are taken to the wordpress homepage in the subdirectory (sweet). In fact everything is hunky-dory besides:
MAIN PROBLEM:
I want to create a custom login URL, say : www.example.com/mylogin
I am able to do the following by setting the following in my .h2
RewriteRule ^mylogin$ wp-login.php
But when I use this URL, it taken me to the login screen but the url in the browser changes to http://example.com/subfolder/wp-login.php
I want the URL that is displayed when the login screen is presented to stay the same as before i.e. http://example.com/mylogin
More precisely, no subfolder name and no wp-login should be displayed. How do I achieve this? Any help would be appreciated.
Your solution doesn’t hide the default login url. It only adds an easier to remember url which redirects to the default url /wp-login.
Without the need for coding you can easily install the plugin Custom Login and Admin URL’s that fixes this weakness.
Caution: This plugin have been tested on a new installation of WordPress and it worked fine. However, most free plugins are unsupported which means they sometimes conflict with other plugins depending on what you have installed. If you have any issues, login to cPanel or FTP and delete the plugin or contact your web hosting provider.
Another Security plugin for WordPress which you may want to take a look at is named Better WP Security. This WordPress plugin offers security settings for WordPress login, registration and admin pages as well as many other anti hacking features to protect your site.

Share session between my site and wordpress blog

I would like to know how to share a session between my website non-wordpress and my wordpress blog on the same domain www.mysite.com, so that when a user is logged in to my site he's also logged in to the blog
I installed wordpress as subdirectory on my site, url for my site is www.mysite.com and I access wordpress like this www.mysite.com/wordpressBlog
On my user_login.php in my main site I activated
session_start();
to activate cookies and on my wordpress wp_unregister_GLOBALS() I added
$no_unset = array( '_SESSION', ...
But nothing happen, when I login to my main site I still have to login to the blog
as a matter of fact my site and wordpress blog are on the same domain. I installed wordpress as subdirectory on my site url for my site is www.mysite.com and I access wordpress like this www.mysite.com/wordpressBlog On my user_login.php in my main site I activated
session_start();
to activate cookies and on my wordpress wp_unregister_GLOBALS() I added $no_unset = array( '_SESSION', ...
But nothing happen, when I login to my main site I still have to login to the blog
In order to be able to share a session cookie between both sites, they will have to run under the same domain name (e.g. mysite.com). The following would be a valid configuration if the session cookie has a scope of mysite.com
www.mysite.com
blog.mysite.com
PS. I don't recommend using Cross Scripting hacks to get around this domain scoping issue. It's limited to a domain for security reasons.
[Edit]
I should also point out that it is entirely valid to have your two sub-domains (sites) hosted on different servers
[Edit]
It is difficult to provide a succinct answer to your question because you are using a non-WP site. My best suggestion for you is to post on the WordPress StackExchange where you may get someone who has done this configuration before.
I believe your issues are centred around the scope of your Cookie from WP. Editing your wp-config.php and setting the COOKIE_DOMAIN to use "" may help with your issue as referred to by this WordPress StackExchange post.
Some posts speak of removing this settign entirely. In any case you need a way to debug your HTTP sessions to see what cookies are being sent using which scope, that is why I recommended FireBug. In any case you're still going to have to re-code your non-WP site to recognise the WP cookies so understanding what's going on is important.
I did come across this other post regarding Multisite Domain Mapping that may help with your knowledge, but this is involved WP sites only so not exactly what you need.

Resources