Not Solved [General] Can we remove index.php after the domain name ?
#14
Not Solved
(2023-06-17, 02:36 AM)PARADOX987 Wrote: for me it works well and the code gave by Laird is working fine

Unfortunately, though, it was buggy, but often enough just "happened to work". Here's code which hopefully this time is working:

(2023-06-15, 08:52 PM)jkcool Wrote: Only Theme Selector index issue is remaining.

Try replacing line 5465 of inc/functions.php:
	if(!empty($_SERVER['SCRIPT_NAME']))
with:
	$location = false;
	if(!empty($_SERVER['REQUEST_URI']))
	{
		$https = !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on';
		$scheme = $https ? 'https://' : 'http://';
		$script_loc = $scheme.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
		$a = explode($mybb->settings['bburl'], $script_loc);
		if(count($a) == 2 && $a[0] == '')
		{
			if($a[1] == '/' || $a[1] == '/index.php')
			{
				// The + 1 is so we leave the trailing slash in case it's the only
				// character left after removing 'index.php' - otherwise, in that
				// scenario, we'd be left with an empty location, which would default
				// to reloading the current URL, which would use 'index.php'.
				$location = htmlspecialchars_uni(substr($_SERVER['REQUEST_URI'], 0, strlen($_SERVER['REQUEST_URI']) - strlen($a[1]) + 1));
			}
		}
	}
	if($location !== false)
	{
		// Do nothing - $location was already set above.
	}
	elseif(!empty($_SERVER['SCRIPT_NAME']))
Reply


Messages In This Thread
RE: Can we remove index.php after the domain name ? - by Laird - 2023-06-17, 06:37 AM

Forum Jump:


Users browsing this thread: 5 Guest(s)