News:

Wondering if this will always be free?  See why free is better.

Main Menu

SimpleSEF 2.0 (SMF 1.1.x and SMF 2.0)

Started by SlammedDime, December 05, 2009, 10:08:40 PM

Previous topic - Next topic

shumilica

This is what it's saying in the error log when i try to go to forum/index.php or any other former known topic url:

[Tue Dec 08 00:45:19 2009] [error] [client ip] File does not exist: /home/fcrpro/public_html/500.shtml


It's a mistery...
May the new version help with something?
Today, if you're not confused it means you're not thinking clear!

SlammedDime

Unlikely, the only thing the newer version fixes is an issue with character sets and languages.  I have to go to work, but I'll give you a change for the .htaccess file tomorrow to test out.  I have to do a bit of research first though.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

SlammedDime

If you do a search in the admin panel for 'Enable compressed output', the result will have the link to the setting in it.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

hartiberlin

Okay, thanks for the hint with the GZIP compression.
I disabled it for now.


2. Could it be, that the Mod redirects all
calls to

domain.com
instead of
www.domain.com ?

So do I have to set in Google Webmastertools the preferred domainname
to:

domain.com
instead of
www.domain.com ?

Many thanks.

hartiberlin

#64
P.S: Does it also change the RSS Feed URL ?

What is the valid RSS Feed URL now, if I want to submit it now
to RSS-Feed sites ?

And the Sitemap MOD URL ?
What is the valid Sitemap URL,
which I should submit to Google Webmastertools ?

SlammedDime

I don't know off the top of my head what the right urls would be... You can use either the old url, or find the new on by looking in the HTML source code... as for the sitemap... again, you'd have to click the XML link in the Sitemap to see what it gets rewritten to.

As for the www. vs lack thereof, I don't really understand.  Whatever you have set for your $boardurl in Settings.php is what the mod uses.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

kingkingston

isn't this the same kind of mod as the Pretty URLs mod ?????

JBlaze

Quote from: kingkingston on December 07, 2009, 09:50:26 PM
isn't this the same kind of mod as the Pretty URLs mod ?????

Kinda. It has the same functionality but a less of a performance hit on the forum. It also does not modify any SMF code except the admin stuff.
Jason Clemons
Former Team Member 2009 - 2012

SlammedDime

Nothing wrong with a little competition kingkingston :)
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Daniel15

Here's instructions for other popular web servers (well, one for now :P).  SlammedDime, if you want to, feel free to add these modifications to your package, and add the instructions to the readme (mention me if you want :))

Lighttpd
In ManageSettings.php, find:
else
$_POST['simplesef_enable'] = 0;

Add before:
elseif (strpos($_SERVER['SERVER_SOFTWARE'], 'lighttpd') !== false)
$_POST['simplesef_enable'] = 1;



Now, in your Lighttpd config file (often /etc/lighttpd/lighttpd.conf), add the following to the bottom:

$HTTP["host"] =~ "(www.)?example.com" {
url.rewrite-once += (
# Allow all normal files
"^/forum/.*\.(js|ico|gif|jpg|png|swf|css|htm|php)(\?.*)?$" => "$0",
# Rewrite everything else
"^/forum/.*$" => "/smf_2-0-rc2_sqlite/index.php"
)
}

Replace example.com with your forum's hostname, and forum with the directory your forum is installed in. Unfortunately, support for disabling rewriting based on the existance of files (what "%{REQUEST_FILENAME} !-f" in Apache does) is not available until Lighttpd 1.4.24, which is a newer release that a lot of people might not have installed. So, my rules explicitly disallow rewriting of normal files. This seems to work alright. :)

I'll post some configuration instructions for Cherokee, once I get the rewriting working properly (having some little problems right now).


@SlammedDime, in ManageSettings.php, I'd suggest changing the use of implode(''file(...)) to file_get_contents, it looks nicer (and is more efficient, but it doesn't really matter on small files) :)
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

SlammedDime

Thanks for the above on Lighttpd daniel... I'll add that info so when I have to release a new version (because I'm sure more bugs will be found), it'll be in there.

As for the implode('', file()) thing... as you said, on the small files it didn't make a difference... in the benchmark I did, the time difference over 10000 iterations was very very small.  It's also not something that is called very often... Believe me, I spent almost a week building in as many optimizations into SimpleSEF.php as I could to reduce load times... :)
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Daniel15

#71
QuoteAs for the implode('', file()) thing... as you said, on the small files it didn't make a difference... in the benchmark I did, the time difference over 10000 iterations was very very small.  It's also not something that is called very often...
I see. I always cringe when I see implode('', file()), since it's quite often used as a hack for PHP 4 compatibility. I can imagine it uses more memory and being slower than file_get_contents since it reads a whole file, splits it into an array (one element per line of the file), then sticks that array back together. It's got the unnecessary overhead of splitting a file and then sticking it back together (practically the same as implode("\n", explode("\n", $file_contents)) :P)

Alright, here's a tutorial for Cherokee. It looks long but things are actually really easy to configure for Cherokee, since the entire administration is done via a GUI. This was tested on Cherokee 0.99.28, which is available as a Debian package in Debian Testing (the version in Lenny/stable is very very old, so I wouldn't suggest using it :P)

Cherokee
Note: This doesn't cover setting up PHP, as it assumes you already have SMF working on a Cherokee install. It assumes you have basic knowledge of Cherokee setup.

In Sources/ManageSettings.php, find:
else
$_POST['simplesef_enable'] = 0;

Add before:
elseif (strpos($_SERVER['SERVER_SOFTWARE'], 'Cherokee') !== false)
$_POST['simplesef_enable'] = 1;



Now, to configure Cherokee. Run cherokee-admin, open it, and go to Virtual Servers --> The vserver containing your domain ("default" if you haven't added any custom vservers). Click on the "Behaviour" tab. We need to add three rules:

1. Under Add new rule, choose "Full Path", and for the Full Path, enter the path to your forum (for example, /forum/).

Press TAB to save and go into the configuration for this rule. On the Handler tab, set Handler to List & Send. Now, this rule is done, so click on the vserver name at the top of the page to go back to the main configuration.

Go back to the "Behaviour" tab

2. Under Add new rule, choose "Directory", and for the Web Directory, enter the web directory your forum is in. Quite often, this will be /.

On the Rule tab, click the "And" button. In the bottom dropdown box, choose "File Exists", and tick "Match any file" and "Use I/O cache":

On the Handler tab, set the handler setting to Static content. Once again, go back to the "Behaviour" tab of the main configuration for the vserver.

3. Under Add new rule, choose "Regular Expression", and for the Full Path, enter the path to your forum followed by (.+) (for example, /forum/(.+)).

Set the following options:
Handler tab
- Handler: Redirection
Under "Add new rule":
- Show: Internal
- Substitution: /forum/index.php (change "forum" to your forum's path)

After adding, it should look like:

Go back to the "Behaviour" tab of the main configuration for the vserver.

Rearrange the rules so they're in this order:
1. php
2. Fullpath rule
3. "Complex" rule (the one set in the second step above)
4. Regular expression rule

Make sure 2, 3, and 4 have the "Final" tickbox checked. It might look something like this:

Click the "Save" button on the left of the page, and everything should work :)

Hope this helps :D
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

hartiberlin

Hi,
there is a problem im 1.0.0
with the attachments.

When I click an attachment picture in a posting,
it comes up with the error message:

Numeric request keys are invalid.

This happens in German as also on English language as the
forum default language.

I attached 7 JPEG pictures to a posting and the links
to it seems also wrong.

Sometimes also this error message comes up:

Fatal error: Call to undefined function getTemplateLayer() in /...xxx../..xxx../ruhleben/Sources/Subs.php on line 3405

(I edited the real path to it due to public security)



hartiberlin

Also in Version 1.0.1
this error is there.

In:
http://www.ruhleben.com/index.php?topic=8.0
(this is again the normal link, cause I have disabled the MOD now..)

When I click the attachment link:

http://www.ruhleben.com/dlattach/attach/1/schloss_ruhleben/karten_und_stadtplan_vom_schloss_ruhleben_8.0.html

it comes up with

Numeric request keys are invalid.

Also when I use the short URL like:

http://www.ruhleben.com/dlattach/attach/1/topic_8.0.html

it comes up with the same error message.

I will now disable again the MOD until a fix is here.

Regards, Stefan.

Xarcell

Ok I'm having some problems and looking for a work-around.

I have Dreamhost and apparently there is a few issues with it. mod_rewrite is always installed by default, but I think the script has conflicts with Dreamhost's Fast-CGI. A google took me to this: http://www.webmasterstalks.com/seo-4-smf/i-have-a-big-bug-t837.0.html;msg4679#msg4679

I tried changing the "QueryString.php" as suggested in that file, but it doesn't work. The other workaround with the php.ini I don't have access to, unless I install my own version of php, which I can't figure out how to do and Dreamhost doesn't offer support on how to do that.

SlammedDime

Xarcell - What problem are you having exactly?  That fix for Querystring.php won't work for this mod, two totally different beasts.

Stefan - open SimpleSEF.php and do the following:

Code (Find) Select
if (!empty($url_array) && (in_array($querystring['action'], array('stats','unread')) === false) && in_array($url_array[0], explode(',', $modSettings['simplesef_subactions'])))


and
Code (Replace) Select
if (!empty($url_array) && (in_array($querystring['action'], array('stats','unread', 'dlattach')) === false) && in_array($url_array[0], explode(',', $modSettings['simplesef_subactions'])))
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Tanshaydar

Hi, I installed this mod to my forum. Got worked. (Turkish forum, ISO-8859-9)
But there are some problems and thing I'd like to do.
Avatars don't show due to dlattach action. Is there a way to disable actions to be converted as SEF url? I just want my boards and topics to be converted as SEF.

I delete all of the actions in settings, but they're just keeping show up again.

SlammedDime

#77
See the post right above yours for the dlattach fix and let me know if it works for you.

As the description above the actions, areas and subactions states, you should NOT remove or change any of those unless you know what you are doing.  Deleting any of them will not help anything, and in most cases can only HURT your forum.

No, there isn't a way to disable actions to be converted.  This is an all or nothing, hence the name, 'Simple'SEF. :)
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Tanshaydar

Ok, it works :)
Thanks for the mod, it's great!

btw, what about boards with same name :\

SlammedDime

As for boards with the same name - I'll work up something so that board names might be prefixed with their category name, or maybe a number.  I'll find some way to work it out that doesn't reduce overhead too much.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Advertisement: