Page 1 of 1

URL Rewriting on GoDaddy

Posted: Fri Feb 02, 2007 6:42 pm
by jonmurray
Hello Everyone,

I've scoured postings on this forum and via google and found lots of people with the problem, but could not find a solution (I'm sure it exists). I'm looking for anyone who has gotten URL rewriting to work with Serendipity (I'm using 1.1) on GoDaddy.

Before we start, yes GoDaddy does support mod_rewrite, but obviously not exactly the same as other hosts since s9y 1.1 works with rewriting just fine for me on hostgator, but not on GoDaddy.

Here's what I get (I'll use my North Pole Christmas blog as an example)

without url rewriting

If I go to the main page (i.e. http://www.north-pole-christmas.com and hit the Christmas Wallpaper category, I get
http://www.north-pole-christmas.com/ind ... -Wallpaper

Now, I go into the admin console and enable URL Rewriting using mod_rewrite
It creates the .htaccess file for me, now I go back to the root url

I hit the Christmas Wallpaper category again, this time I get the re-written URL as follows
http://www.north-pole-christmas.com/cat ... -Wallpaper

However, I get a blank page.

Now, if I add a / to the end of the url as follows
http://www.north-pole-christmas.com/cat ... Wallpaper/

and hit enter, the Christmas Wallpaper category comes up. This behaviour is consistent for everything. It all seems to need that trailing slash to work.

If anyone has any ideas on what to try, or has gone through this themselves, I'd really appreciate some guidance :-)

Thanks!

BTW: Serendipity is by far my favorite blog engine...just need to get this little quirk ironed out.

Note: I am able to get around the problem for categories by changing the permalinks for catagories to have a trailing slash "/", but it doesn't work for things like rss feeds.

Re: URL Rewriting on GoDaddy

Posted: Sat Feb 03, 2007 12:45 pm
by garvinhicking
Hi!

That really sounds strange, I'm guessing that on the godaddy servers some mod_rewrite option might be set that interfers with the way $_SERVER['REQUEST_URI'] is set.

I could only check that out if someone could give me FTP access to a godaddy s9y installation, then I could try some things out?

Best regards,
Garvin

I'll set up a test install and let you know when it's done.

Posted: Sat Feb 03, 2007 4:23 pm
by jonmurray
Hi Garvin,

I'll set up a test install and an ftp access account. I'll let you know when it's done.

Test Site is set up

Posted: Sun Feb 04, 2007 3:40 pm
by jonmurray
Hi Garvin,

I set up a test site for you on GoDaddy. I PM'd you the login details.

It's a serendipity 1.1 install and I also gave you an ftp account.

FYI

Jon

Posted: Fri Mar 02, 2007 8:21 am
by snowcrash+s9y
hi,

did you ever get this working with godaddy? if so, could you post/share what you found?

thanks!

I didn't completely figure it out, but did get a solution

Posted: Thu Mar 08, 2007 7:24 pm
by jonmurray
This might not be all you want and it will require a little work:

Here's the link where I've loosly documented what I've done:

http://projectadsense.gocurious.com/arc ... Daddy.html

The Project AdSense blog is Serendipity on GoDaddy. I'd prefer a better solution, but I don't think that will happen any time soon.

The notes I left on this entry are more a reminder to myself than a how-to.

I changed the permalinks as needed, then edited the file mentioned:

I added trailing slashes to the following permalinks:
Path to admin
Path to archive
Permalink RSS-Feed Author URL structure
Permalink RSS-Feed Category URL structure
Permalink Category URL structure
Permalink Author URL structure

But still found my .rss entries not working, that's when I edited the
include/plugin_internal.inc.php
File to include a trailing slash on some entries. search for index.rss1, I think the second instance add the trailing slash.

i.e. I changed

<div style="padding-bottom: 2px;">
<a href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/index.rss1', 'serendipityHTTPPath') ?>"><img src="<?php echo serendipity_getTemplateFile('img/xml.gif'); ?>" alt="XML" style="border: 0px" /></a>
<a href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/index.rss1', 'serendipityHTTPPath') ?>">RSS 1.0 feed</a>
</div>

to

<div style="padding-bottom: 2px;">
<a href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/index.rss1', 'serendipityHTTPPath') ?>"><img src="<?php echo serendipity_getTemplateFile('img/xml.gif'); ?>" alt="XML" style="border: 0px" /></a>
<a href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/index.rss1/', 'serendipityHTTPPath') ?>">RSS 1.0 feed</a>
</div>

Note the second /index.rss1 entry now has a trailing slash. I also did this for the other "rss" entries:

index.rss, index.rss2 and comments.rss2

It seems to be working fairly well and I've noticed that google is indexing the new SEO URLs now.

I hope this helps.

John

Posted: Thu Mar 08, 2007 7:58 pm
by snowcrash+s9y
thanks! i'll give this a try.

based on the file mod, it will not survive a serendipity version update, but, one step at a time, i suppose.

godaddy, although not the most 'robust' hosting solution, is certainly cost-effective, and increasingly popular.

perhaps the author(s) can cleverly add/integrate a fix in to the src ...

thanks again.

Posted: Fri Mar 09, 2007 10:10 am
by garvinhicking
Hi!

There are many other occurences than just the RSS feeds were a trailing slash is not added.

It does not make sense to add trailing slashes in the configuration, as it will have effects on SEO and spiders if files don't have an extension like ".rss" and are instead thought to be directories.

I must admit I don't really understand why trailing slashes are required, I don't know what's causing this - I only know it's not s9y, but it must be some mod_rewrite setting. Maybe that can be undone in the .htaccess.

Regards and good luck,
Garvin

True enough, but for now.

Posted: Fri Mar 09, 2007 6:19 pm
by jonmurray
Hi Garvin,

While I am not happy with this solution, I have not been able to come up with anything else. It's gets around many of the SEO issues (for me). I did not post it back here originally, because I did not like the solution for others, but since I was asked...

Serendipity works fine for me on Host Gator with mod_rewrite enabled. It seems however that no matter how many times GoDaddy is asked, they claim

"mod_rewrite" is enabled and working.

This is certainly true, and products like Joomla seem to have no problems with rewriting URL's on GoDaddy. However, we cannot argue that there is something in GoDaddy's config for mod_rewrite which is not allowing Serendipity to work properly :-(

BTW: WordPress and Nucleus "fancy" or "seo" URL's do not work with GoDaddy either :-(

I would love to move all my Serendipity blogs over to Host Gator, but unfortunately I have a lot of them (maybe 10 or more) and just don't have the free time to move them. Not only that, some of them (like Project AdSense and MMA are subdomains of my main domain, which would mean moving everything in the gocurious domain over....a huge pain). The change I made, while incomplete does allow Google to spider my pages with "nice urls" and for now, that'll have to be good enough for me.

Re: True enough, but for now.

Posted: Sun Mar 11, 2007 12:52 pm
by garvinhicking
Hi!

Maybe you could get GoDaddy to reveal their mod_rewrite settings (all options set in the apache config with relevance to mod_rewrite). Then I could try to simulate those settings on my server and look which one of them makes the trouble exactly. Then we can try to workaround that by setting the option in a custom .htaccess file.

Best regards,
Garvin