#1 August 8, 2014 12:07pm

jmason03
Member
Registered: January 9, 2014
Posts: 123

403 Forbidden Access

I've created about 60-70 top level pages in BigTree and it looked like everything was going smoothly but now there are certain pages (4 so far) that when I browse to them I'm getting a 403 Forbidden Access. I know that some of these pages worked in the past and now do not. I have not changed any URL Rewrite settings in IIS or any other settings. I was wondering if this was a known issue or if someone else had some success when they encountered it?

Some of the URLs that don't work: /web    /career    /counseling

Thanks

Offline

#2 August 8, 2014 12:09pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: 403 Forbidden Access

Can't say I've ever seen a 403 error -- I know none are generated directly by the CMS. Maybe check the IIS server logs to see if there's any more info?

Offline

#3 August 8, 2014 12:31pm

jmason03
Member
Registered: January 9, 2014
Posts: 123

Re: 403 Forbidden Access

Ok, I think I have at least figured out what the problem is. We have other files like forms and pdf documents and other things on our old site that we are moving to this new server. In doing so we have to recreate the folder structure so all of our links will still work. Meaning that I have a page in bigtree with a URL /career and then I have to make a folder inside my site folder called career and then put some files in that. It's in these cases that I'm getting the 403. I'm assuming this is because my server is looking for an index.php file in these folders and not finding one. Am I just going to have to create redirects somehow or are there rewrite rules to get around this or is not possible for me to have a /career page in BigTree and a career folder within my site folder?

Offline

#4 August 8, 2014 2:50pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: 403 Forbidden Access

You won't be able to have both a /career/ page in BigTree and also in the file system since the htaccess rewrites check for real directories first. I believe BigTree will check at page creation time that it's not colliding with a real directory but if the directory is added afterwards there's currently no auditing tool that will update the BigTree URLs.

Offline

#5 August 27, 2014 1:38pm

jmason03
Member
Registered: January 9, 2014
Posts: 123

Re: 403 Forbidden Access

Thought I'd share this, if anyone ever runs across the 403 Forbidden Access problem because they create a folder that shares the same name as a page route then this should fix it. Essentially, it parses out the URL and then queries BigTree and loads your template content. This would be the index.php file for the offending folder, paths may need to be adjusted to reflect placement in folder hierarchy.

<?
    $serverRoot = str_replace("site\\","",__FILE__);
	$serverRoot = strtolower($serverRoot);
	$filePath = str_replace("/", "\\", $_SERVER['PHP_SELF']);
	$filePath = strtolower($filePath);
	$folderPath = str_replace("\index.php", "", $filePath);
	$folderPath = ltrim($folderPath, "\\");
	$serverRoot = str_replace($filePath, "", $serverRoot);
    include $serverRoot."/templates/config.php";
    include $serverRoot."/core/bootstrap.php";
	
	$pageInfo = sqlfetch(sqlquery("SELECT resources, id, parent, nav_title, meta_keywords, meta_description, template FROM bigtree_pages WHERE path = '".$folderPath."'"));
	$BigTreeCMSClass = new BigTreeCMS();
	$bigtree["resources"] = $BigTreeCMSClass->decodeResources($pageInfo["resources"]);
	$bigtree["page"]["title"] = $pageInfo["nav_title"];
	$bigtree["page"]["id"] = $pageInfo["id"];
	$bigtree["page"]["nav_title"] = $pageInfo["nav_title"];
	$bigtree["page"]["callouts"] = $bigtree["resources"]["callouts"];
	$bigtree["page"]["meta_description"] = $pageInfo["meta_description"];
	$bigtree["page"]["meta_keywords"] = $pageInfo["meta_keywords"];
	$calloutIncludePath = "../../templates/callouts/";
	require '../../templates/layouts/' . $pageInfo["template"] . '.php';
?>

Offline

#6 August 27, 2014 1:56pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: 403 Forbidden Access

Awesome, thanks for sharing!

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.