In localhost all is okay.
But I have a hosting where in the /public_html/site folder I have the main WordPress site. I have another PHP site which has no htaccess in /public_html/site/BETA.
You can login here: <a href="http://yoursocialtool.com/BETA/login.php" rel="nofollow">http://yoursocialtool.com/BETA/login.php</a>
User: stack
Password: overflow
Now the problem is when I am trying to logout after login using a form submission to the same page like as <a href="http://yoursocialtool.com/BETA/dashboard.php" rel="nofollow">http://yoursocialtool.com/BETA/dashboard.php</a> it says:
<blockquote>
404 Page not found!
</blockquote>
But if I directly put the url in the browser address bar <a href="http://yoursocialtool.com/BETA/dashboard.php" rel="nofollow">http://yoursocialtool.com/BETA/dashboard.php</a> then its loading fine without any 404 error.
The .htaccess in /public_html:
The .htaccess in /public_html/site:
Here is the codes which I am using in my dashboard.php:
And the problem which I am facing is that the code is not executing JavaScript redirect in the server after login. Actually its not getting the dashboard.php after I am submitting the logout request although it seems to have logout successfully. I am handling the logout action in the dashboard.php also. Seems to be that the /public_html/site/index.php is handling it only after the logout submission.
N.B: My localhost have only the part of the site under /public_html/site/BETA. So the localhost does not have any htaccess or wordpress.
But I have a hosting where in the /public_html/site folder I have the main WordPress site. I have another PHP site which has no htaccess in /public_html/site/BETA.
You can login here: <a href="http://yoursocialtool.com/BETA/login.php" rel="nofollow">http://yoursocialtool.com/BETA/login.php</a>
User: stack
Password: overflow
Now the problem is when I am trying to logout after login using a form submission to the same page like as <a href="http://yoursocialtool.com/BETA/dashboard.php" rel="nofollow">http://yoursocialtool.com/BETA/dashboard.php</a> it says:
<blockquote>
404 Page not found!
</blockquote>
But if I directly put the url in the browser address bar <a href="http://yoursocialtool.com/BETA/dashboard.php" rel="nofollow">http://yoursocialtool.com/BETA/dashboard.php</a> then its loading fine without any 404 error.
The .htaccess in /public_html:
Code:
RewriteOptions inherit
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursocialtool.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.yoursocialtool.com$
RewriteCond %{REQUEST_URI} !site/
RewriteRule (.*) /site/$1 [L]
The .htaccess in /public_html/site:
Code:
# 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
Here is the codes which I am using in my dashboard.php:
Code:
<?php
error_reporting(E_ALL);
ini_set('display_errors','On');
ini_set('error_log','error.log');
require("config.inc.php");
require("__require_login.php");
require_once("_isconnected.php");
if (isAppLoggedIn()){
require("_dashboard.html.php");
} else {
echo ($msg);
?>
<script>
window.location = "./login.php?from=dashboard&location=";
window.location.assign("./login.php?from=dashboard&location=assign");
</script>
<?php
}
?>
And the problem which I am facing is that the code is not executing JavaScript redirect in the server after login. Actually its not getting the dashboard.php after I am submitting the logout request although it seems to have logout successfully. I am handling the logout action in the dashboard.php also. Seems to be that the /public_html/site/index.php is handling it only after the logout submission.
N.B: My localhost have only the part of the site under /public_html/site/BETA. So the localhost does not have any htaccess or wordpress.