rockstar
rockstar

Reputation: 3538

php redirecting to XAMPP folder

My problem is the similar to the one faced here https://stackoverflow.com/questions/320205/why-does-my-xampp-installation-auto-redirect-to-http-localhost-xampp but unfortunately none of the solutions seem to work . I have done the following

a ) Consistently cleared the cache

b) renamed my index.php file in the htdocs folder to index_int.php .

I cant figure out why the redirection is failing . Do i need to make some changes in any of the config files as well ? I read in some post about prioritizing redirection . " The httpd.conf file is setup to prioritize .php files " Is it true . What should i edit in this file if that is the case .

Upvotes: 1

Views: 3907

Answers (2)

rockstar
rockstar

Reputation: 3538

I think i should answer my question . i suspect the problem comes from the fact that i have not as yet configured my testing evirnonment to allow facebook to test apps locally. Here is the failing piece of code -

$facebook_login_url = $facebook->getLoginUrl(array('scope' => $facebook_app_permissions, 'redirect_uri' => $redirect_uri));

It works perfectly on a live server but does not on my local environment . I figured out that i need to set up Developing and Testing a facebook appl locally . Here are some posts about it Developing and Testing a Facebook application .

I hope this saves someone time while debugging the seemingly mysterious redirection of xampp.

Upvotes: 1

Baba
Baba

Reputation: 95121

Hello XAMPP has 2 index page one is index.html and the other is index.php

If you rename index.php it would not work because the back up would take over ... the index.php content looks like this

if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
    $uri = 'https://';
} else {
    $uri = 'http://';
}
$uri .= $_SERVER['HTTP_HOST'];
header('Location: '.$uri.'/xampp/');
exit;

Just change the /xampp/ to what you want .. let me know if there are still issues

Upvotes: 1

Related Questions