Frontpage detection

Creating and modifying plugins.
Post Reply
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Frontpage detection

Post by judebert »

Garvin,

Since it's a US holiday, I'm using a part of my spare time to update the newsbox plugin. Templating is just a bit too problematic for one day, so I'm just trying to use your frontpage detection.

It almost works for me. The only problem is that when I go to my default URL (http://judebert.com/), it gets redirected to http://judebert.com/wasted_youth/index.html. The genpage.inc.php sees the index.html as the URI arguments, and notices that it's not index.php, so it decides I'm not on the frontpage.

Everywhere else is fine.

I tried modifying my .htaccess, but that had no noticeable effect. (Maybe I'm just not doing it right.) I tried changing my index file in the s9y configuration, but that was a big mistake: suddenly it couldn't find my CSS, and made weird links that didn't really go anywhere. I also tried changing the URL to my blog in s9y config, but that just got me 404s.

Finally, I changed the frontpage detection to:

Code: Select all

if ((empty($uri_addData['uriargs']) || trim($uri_addData['uriargs']) == $serendipity['indexFile'] || trim($uri_addData['uriargs']) == 'index.html') && empty($serendipity['GET']['subpage'])) {
    $uri_addData['startpage'] = true;
}
That works for me, but I don't know if it's a problem for others. I figured I'd better not go committing something I wasn't certain about, so I'm deferring it to you.

Comments?
Judebert
---
Website | Wishlist | PayPal
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Frontpage detection

Post by garvinhicking »

How does it come that it redirects to "index.html" in first place? It should be changed so that it redirects to "index.php"...

Do you have a "index.html" file in your directory? How is the redirection performed? What does your .htaccess file look like?

Viele Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

The search engines all expect index.html, from the old site structure. I think my domain name redirects there; I could change that.

I'll modify the .htaccess to redirect 301 to index.php, so the search engines understand and I don't lose my standings.

Thanks!
Judebert
---
Website | Wishlist | PayPal
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Yes, I think such would do better than the other idea of modificating the PHP Code...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply