Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

Static content homepage
(1 viewing) (1) Guest
Support forum for users using free edition of JoomSEF 3 (Joomla 1.5 compatible). These forums are mainly for mutual help between users.

Please note that due to our capacity limitations, we do not monitor these forums regularly.

TOPIC: Static content homepage

Re:Static content homepage 18 years ago #1015

OK, I think I found a solution:

In Joomla root index.php you should insert this lines written with bold style:

// Set flag that this is a parent file
define( '_VALID_MOS', 1 );

// Redirection for static content as homepage

$host=$_SERVER["REQUEST_URI"];
// check if $_SERVER["REQUEST_URI"] is "/", if yes we go to a special page
if ( $host == "/" ) {
$location="www.yoursite.com/homepage.html";
header( "Location: $location" );
exit();
}

// Enf of redirection for static content as homepage


// checks for configuration file, if none found loads installation page
if (!file_exists( 'configuration.php' ) || filesize( 'configuration.php' ) < 10) {
$self = str_replace( '/index.php','', strtolower( $_SERVER['PHP_SELF'] ) ). '/';
header("Location: " . $_SERVER['HTTP_HOST'] . $self . "installation/index.php" );
exit();
}

Of course you should change www.yoursite.com and homepage.html as you want to use!

Re:Static content homepage 18 years ago #1077

Of course a redirect will work but this doesn't fix the problem.

I run the component on at least 5 Sites now and i have this problem on totally random. Two sites did run fine after i unpublished and republished the content or altered the order in the mainmenu.

But three sites refuse to show the homepage for an unknown reason to me. My customers relly want this component but i don't have a clue how to produce a workaround for this.

A default setting maybe helpfull. If its not a 404 do show this page.

On one site i use a different template for the homepage and the correct template is shown but not the content. By this i think it correctly resolves the menuitem but not the content id.

Its too much code fpr me to hack into. But in some tests i cam eto believe that an itemid is set but no id not even the 999999 fallback.

Please fix this. I will buy your Virtuemart add on! :)

[Edit] i tried the 1.3.1 with absolutly no chance. This is just random. Doesn't matter if i use static or content with section and category<br><br>Post edited by: KarsT, at: 2006/12/13 12:36

Re:Static content homepage 17 years, 10 months ago #1483

Zoltan Varanka wrote:
OK, I think I found a solution:

In Joomla root index.php you should insert this lines written with bold style:

$host=$_SERVER[&quot;REQUEST_URI&quot;];
// check if $_SERVER[&quot;REQUEST_URI&quot;] is &quot;/&quot;, if yes we go to a special page
if ( $host == &quot;/&quot; ) {
$location=&quot;www.yoursite.com/homepage.html&quot;;
header( &quot;Location: $location&quot; );
exit();
}

Of course you should change www.yoursite.com and homepage.html as you want to use!


Thank you for this Zoltan :)

Will this issue be fixed in future versions? or would we need to amend the index.php for future joomla sites too?

Regards

Shafiq :sK<br><br>Post edited by: shafiqkhan, at: 2007/02/09 16:50

Re:Static content homepage 17 years, 8 months ago #1860

First, I love this SEF. With a little polishing, it definitely will take the lead in the Joomla SEF race.

I, like many, have had problems with the homepage after installing JoomSEF. Of particular concern was the issue with static content pages set as the homepage. I'm happy to report that I think I have solved the problem at the core level, and not as a workaround.

Here's what was missing (shown using 1.4.2):

In /components/com_sef/joomsef.php at around line 58, after
  $matches = array();
if (preg_match(&quot;/option=([a-zA-Z_0-9]+)/&quot;, $QUERY_STRING, $matches)) {
$_GET['option'] = $_REQUEST['option'] = $option = $matches[1];
}


insert this

 if (preg_match(&quot;/id=([0-9]+)/&quot;, $QUERY_STRING, $matches)) {
$_GET['id'] = $_REQUEST['id'] = $id = $matches[1];
}
if (preg_match(&quot;/task=([a-zA-Z_0-9]+)/&quot;, $QUERY_STRING, $matches)) {
$_GET['task'] = $_REQUEST['task'] = $task = $matches[1];
}
 


What was missing was the script checking for two vital pieces of information used when displaying a static content page as the home: 1) the ID number for the content and 2) the task (which will be &quot;view&quot;). These are not necessary for displaying the content as &quot;com_frontpage&quot; since it doesn't require an id or a task, but just the option and Itemid number.

Hope that helps!

And to the developers, it would be a huge help to include it in your next release.

Re:Static content homepage 17 years, 8 months ago #1863

  • miun
  • OFFLINE
  • A pesimist is just a well-informed realist.
  • Posts: 563
Dear Nate,

thank you very much for your contribution. We have added this code to the current release.

Best regards,
ARTIO Support Team
ARTIO Support Team

Re:Static content homepage 17 years, 2 months ago #3292

The correction discussed in this topic (Static content homepage, posted by Nate West back in April) and placed in the official source code, does fix the 403's, but it leaves the com_frontpage as the \&quot;homepage\&quot; that responds to \&quot;thisurl/\&quot; and \&quot;thisurl/index.php\&quot;. The problem is that con_frontpage is hardcoded as the homepage; this can be fixed by the following code change, just above the change just discussed:

 
$query = \&quot;SELECT `id`,`link` FROM #__menu WHERE `menutype` = 'mainmenu' AND published` &gt; 0 AND `ordering` = 1;
//`link` LIKE '%com_frontpage%' LIMIT 1\&quot;;
 



I believe this takes care of the difficulty and makes JoomSEF consistent with the Joomla! homepage rule: The first item on the main menu is the home page.
User Login Empty