News:

Want to get involved in developing SMF, then why not lend a hand on our github!

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

SlammedDime

I suppose I could add an error handler to throw a 404 if the requested action isn't found, shouldn't be too hard.

As for the custom rewrite... you can add as many rewrites/redirects to .htaccess as you want, but they all have to come before the SimpleSEF rewrite...

For the 'mypagename', you would need to copy/paste that rule for each page you want to redirect and change 'mypagename' appropriately. (this should work, but it's untested).

ie:

RewriteRule ^(mypagename)$ index.php?spage=$1 [R,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

atfosan

Unbelievable... It works! But I'm remembering I had tested this variant early and it doesn't work... May be somthing went wrong...

And error page function we are waiting. :)
my SMF project - school site: forum with PortaMx and SimpleSEF mods

Phoestre

Quote from: atfosan on June 30, 2010, 02:30:57 PM
Quote from: Phoestre on June 30, 2010, 12:17:53 PM
I'm sure its something easy once we found how to add custom/manual rewrites/redirects to SimpleSEF code, but we need to find first where and how, then specific redirects(like /pagename to /spage,pagename or /sitemap.xml to /sitemap/xml) can be made by us.

Hm... If SlammedDime, creator of mod, do not insert custom redirect feature to the mod, may be it is not so easy...

And why do you need to rewrite your XML-sitemap address? You can write to the robots.txt or to the Google Webmasters' Tools "http://example.com/index.php?action=sitemap;xml" at all (as I made :) ).

A total feature is not needed, just knowing how to make it would be enough :) which is answered by him after your post.

Quote from: SlammedDime on June 30, 2010, 02:47:47 PM
I suppose I could add an error handler to throw a 404 if the requested action isn't found, shouldn't be too hard.

As for the custom rewrite... you can add as many rewrites/redirects to .htaccess as you want, but they all have to come before the SimpleSEF rewrite...

For the 'mypagename', you would need to copy/paste that rule for each page you want to redirect and change 'mypagename' appropriately. (this should work, but it's untested).

ie:

RewriteRule ^(mypagename)$ index.php?spage=$1 [R,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php


I checked it but its giving a wrong redirection error(an indefinite redirection started etc..)

RewriteRule ^(sitemap.xml)$ index.php?action=sitemap;xml$1 [R,L]

This is what I tried, I placed before your rewrites. This may be only me, not sure if thats the situation for everybody.

About the error handler, this would be like the finalizing brush on a painting :) Its something really needed but I understand it isn't priority for everybody.

SMF 2.0RC3 + SimplePortal
Custom Theme + Latin5 Turkish
Ubuntu Lucid

atfosan

#763
Phoestre
RewriteRule ^(sitemap.xml)$ index.php?action=sitemap;xml [R,L]
try that.

SlammedDime
And what is the future of mod? Do you have any TODO list? Or you only stabilize SimpleSEF without developing new feature?
my SMF project - school site: forum with PortaMx and SimpleSEF mods

Phoestre

Quote from: atfosan on June 30, 2010, 03:10:25 PM
Phoestre
RewriteRule ^(sitemap.xml)$ index.php?action=sitemap;xml [R,L]
try that.
...

I tried that before but just to be sure I just retried still the indefinite loop error. I see the diffrence between what I posted and what you posted you removed the "$1" I tried with and without it too, result is same.
The only thing that has a diffrent result is
QuoteRewriteRule ^(sitemap.xml)$ /sitemap/xml/ [R,L]
This results in www.test.com/sitemap.xml being sent to www.test.com/sitemap/xml/ address. I want the www.test.com/sitemap.xml address to stay. Anyways its not much important, I can live with that ;D

SMF 2.0RC3 + SimplePortal
Custom Theme + Latin5 Turkish
Ubuntu Lucid

atfosan

Quote from: Phoestre on June 30, 2010, 03:34:44 PM
This results in www.test.com/sitemap.xml being sent to www.test.com/sitemap/xml/ address. I want the www.test.com/sitemap.xml address to stay. Anyways its not much important, I can live with that ;D

I want too. If you find the way to realize that PM me please!
I was finding a few but don't get result...
my SMF project - school site: forum with PortaMx and SimpleSEF mods

SlammedDime

Get rid of the 'r'...

RewriteRule ^(sitemap.xml)$ /sitemap/xml/ [L]

The 'R' tells apache to redirect, rather than just rewrite.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

atfosan

Quote from: SlammedDime on June 30, 2010, 04:08:40 PM
Get rid of the 'r'...

RewriteRule ^(sitemap.xml)$ /sitemap/xml/ [L]

The 'R' tells apache to redirect, rather than just rewrite.

Doesn't work for me...
And what about TODO list?
my SMF project - school site: forum with PortaMx and SimpleSEF mods

Phoestre

Quote from: SlammedDime on June 30, 2010, 04:08:40 PM
Get rid of the 'r'...

RewriteRule ^(sitemap.xml)$ /sitemap/xml/ [L]

The 'R' tells apache to redirect, rather than just rewrite.

This results in a broken version of SimplePortal's frontpage(articles are in the center but all other portal blocks are missing). This is also the case with unexisting pages, thats why I asked for an error handling feature.

SMF 2.0RC3 + SimplePortal
Custom Theme + Latin5 Turkish
Ubuntu Lucid

mirahalo

im getting this error when I try to create a new board:

8: Undefined index: 60

Archivo: path_to/forum/Sources/SimpleSEF.php
Líne: 455


it does create the board but the link to the new board shows only mysite.com/foro  when it should be  myforum/forum/my_new_board


around line 455 theres this function getBoardName()

function getBoardName($id)
{
global $modSettings, $simpleSEF;

if (!empty($modSettings['simplesef_simple']))
$boardName = 'board' . $modSettings['simplesef_space'] . $id;
else
{
if (stripos($id, '.') !== false )
{
$page = substr($id, stripos($id, '.') + 1);
$id = substr($id, 0, stripos($id, '.'));
}

$boardName = $simpleSEF['boardNameList'][$id];
if (isset($page) && ($page > 0))
$boardName = $boardName . $modSettings['simplesef_space'] . $page;
}
return $boardName;
}



by the way, 60 is the id of the board I created.



greetings.

SlammedDime

Clear your forum file cache.  Board names are cached, so when a new one is created or modified, the cache needs to be cleared.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

mirahalo


Pellets

#772
Im running SMF 2.0 RC 3. I got a problem with SimpleSEF.

I cant get this plugin to work as it should. My URLs look like "http://www.xxxx.se/2/_970.0.html". Shouldn't it look more like: "http://www.xxxx.se/2/some_random_topic_970.0.html"?



Edit:

I dont use English as standard language, do I need to edit my "Modifications.swedish-utf8.php" file?

ab1cor

When SimpleSEF activated, I'm getting this error on top of the page when entering any forum: Warning: sef_strrpos(): Offset not contained in string. in /home/lasaldig/public_html/Sources/SimpleSEF.php on line 755

And the url looks like: h t t p://mysite/ /       <--- no forum name, just a blank space between bars...

yoghurtfarmer

I'm getting a weird problem with 2.0 RC3 running Simple Portal with SimpleSEF.

In the Actions field in the admin SimpleSEF configuration, it lists this:

activate,admin,announce,attachapprove,buddy,calendar,clock,collapse,coppa,credits,deletemsg,display,dlattach,editpoll,editpoll2,emailuser,findmember,groups,help,helpadmin,im,jseditor,jsmodify,jsoption,lock,lockvoting,login,login2,logout,markasread,mergetopics,mlist,moderate,modifycat,modifykarma,movetopic,movetopic2,notify,notifyboard,openidreturn,pm,post,post2,printpage,profile,quotefast,quickmod,quickmod2,recent,register,register2,reminder,removepoll,removetopic2,reporttm,requestmembers,restoretopic,search,search2,sendtopic,smstats,suggest,spellcheck,splittopics,stats,sticky,theme,trackip,about:mozilla,about:unknown,unread,unreadreplies,verificationcode,viewprofile,vote,viewquery,viewsmfile,who,.xml,xmlhttp,page,vancouvernews,page,vancouverevents,media ....

After that ,page,vancouvernews,page,vancouverevents, (the SimpleSEF pages) repeat over and over countless times.

I've erased the duplicates but they always come back.


feline

Yea .. SimpleSEF will change the action list continuing, I think that is a heave bug.
You can comment out these code part in the file /Sources/SimpleSEF.php ..
Find:

// Check to see if we need to update the actions lists
$changeArray = array();
$possibleChanges = array('actions', 'useractions');
foreach ($possibleChanges as $change)
if (empty($modSettings['simplesef_' . $change]) || (substr_count($modSettings['simplesef_' . $change], ',') + 1) != count($simpleSEF[$change]))
$changeArray['simplesef_' . $change] = implode(',', $simpleSEF[$change]);

if (!empty($changeArray))
{
updateSettings($changeArray);
$simpleSEF['query_count']++;
}

Add a /* before the first code line and a */ after the last code line to comment out this part.

Fel

SlammedDime

Odd that just those repeat themselves... do you have the custom action mod or did you make those pages yourself?
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

yoghurtfarmer

I just made them through Simple Portal.

maipgeut

i have this problem with this mod.


I uninstall the pretty urls, delete the tables and the .htaccess, then i installed the simplesef, but with the error seen in the image.

thanks in advice for your answer
Ingresa a forosdelvago.com

SlammedDime

Looks like one of the SimpleSEF-Db files is missing it's opening PHP tags... I'll have to run through them a little bit later on
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Advertisement: