Skip to:
Content
Pages
Categories
Search
Top
Bottom

Topics Per Page plugin – new problem


  • TrishaM
    Participant

    @trisham

    Re-posted my comment from another thread to here….thought it might get better exposure this way to help find a solution sooner.

    When I am on my Front Page and click on any of the other pages numbers (2, 3, Next>>, etc) that are inserted by this plugin, I get this error:

    Warning: preg_replace() [function.preg-replace]: Compilation failed: nothing to repeat at offset 0 in /[myURL]/Forum/bb-includes/template-functions.php on line 925

    This only happens on my front-page.php. Clicking on the numbers in my forum.php or topic.php works just fine – goes to that page number.

    Any ideas?

Viewing 11 replies - 26 through 36 (of 36 total)

  • _ck_
    Participant

    @_ck_

    Ah okay. Well the “slugs” part will be the last part after the .htaccess is working to finally get slugs.

    We should probably approach this in baby steps to see what triggers it.

    That “Multiple Choices” error is not good.

    It means MultiViews is still ON for some reason when it should not be. Maybe you did the MultiViews turn off incorrectly?

    Right now I assume the webroot has a .htaccess with Options -MultiViews at the top, then the rest of what you listed above for WordPress. Like so:

    Options -MultiViews

    RewriteEngine On
    RewriteCond %{http_host} ^travel-writers-exchange.com
    RewriteRule ^(.*) http://www.travel-writers-exchange.com/$1 [R=301,L]
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} !^/Forum/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    Now in /Forums/ I want you to make a reduced .htaccess file like this:

    Options -MultiViews

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /Forum/
    </IfModule>

    Make that minimal amount and see if it that still functions without a 500 error. (keep the slugs disabled for now)


    TrishaM
    Participant

    @trisham

    Ok…..here is what I have in my (root) WP install folder:

    Options -MultiViews
    RewriteEngine On
    RewriteCond %{http_host} ^travel-writers-exchange.com
    RewriteRule ^(.*) http://www.travel-writers-exchange.com/$1 [R=301,L]
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} !^/Forum/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    I also modified my .htaccess file in /Forum as follows:

    Options -MultiViews
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /Forum/
    </IfModule>

    No 500 Server error – Yaay! this is progress….slugs are still disabled.


    _ck_
    Participant

    @_ck_

    Okay now trying adding the first two forum lines the /Forum/ .htaccess

    Options -MultiViews
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /Forum/
    RewriteRule ^forum/([^/]+)/page/([0-9]+)/?$ /Forum/forum.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^forum/([^/]+)/?$ /Forum/forum.php?id=$1 [L,QSA]
    </IfModule>


    _ck_
    Participant

    @_ck_

    Oh I just thought of another possible problem.

    Try also adding

    Options +FollowSymLinks

    after the

    Options -MultiViews

    That might be the entire 500 error issue.

    Some servers require it for mod_rewrite to work properly.


    TrishaM
    Participant

    @trisham

    Okay – so far so good – added the Options +FollowSymLinks after the -Multiviews and added the two lines to RewriteRule – no 500 error yet :)


    _ck_
    Participant

    @_ck_

    I think we solved it then.

    Try adding the rest of the rules.

    RewriteRule ^topic/([^/]+)/page/([0-9]+)/?$ /Forum/topic.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^topic/([^/]+)/?$ /Forum/topic.php?id=$1 [L,QSA]
    RewriteRule ^tags/([^/]+)/page/([0-9]+)/?$ /Forum/tags.php?tag=$1&page=$2 [L,QSA]
    RewriteRule ^tags/([^/]+)/?$ /Forum/tags.php?tag=$1 [L,QSA]
    RewriteRule ^tags/?$ /Forum/tags.php [L,QSA]
    RewriteRule ^profile/([^/]+)/page/([0-9]+)/?$ /Forum/profile.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^profile/([^/]+)/([^/]+)/?$ /Forum/profile.php?id=$1&tab=$2 [L,QSA]
    RewriteRule ^profile/([^/]+)/([^/]+)/page/([0-9]+)/?$ /Forum/profile.php?id=$1&tab=$2&page=$3 [L,QSA]
    RewriteRule ^profile/([^/]+)/?$ /Forum/profile.php?id=$1 [L,QSA]
    RewriteRule ^profile/?$ /Forum/profile.php [L,QSA]
    RewriteRule ^view/([^/]+)/page/([0-9]+)/?$ /Forum/view.php?view=$1&page=$2 [L,QSA]
    RewriteRule ^view/([^/]+)/?$ /Forum/view.php?view=$1 [L,QSA]
    RewriteRule ^rss/?$ /Forum/rss.php [L,QSA]
    RewriteRule ^rss/topics/?$ /Forum/rss.php?topics=1 [L,QSA]
    RewriteRule ^rss/forum/([^/]+)/?$ /Forum/rss.php?forum=$1 [L,QSA]
    RewriteRule ^rss/forum/([^/]+)/topics/?$ /Forum/rss.php?forum=$1&topics=1 [L,QSA]
    RewriteRule ^rss/topic/([^/]+)/?$ /Forum/rss.php?topic=$1 [L,QSA]
    RewriteRule ^rss/tags/([^/]+)/?$ /Forum/rss.php?tag=$1 [L,QSA]
    RewriteRule ^rss/profile/([^/]+)/?$ /Forum/rss.php?profile=$1 [L,QSA]
    RewriteRule ^rss/view/([^/]+)/?$ /Forum/rss.php?view=$1 [L,QSA]


    _ck_
    Participant

    @_ck_

    I have to leave for the rest of the day but essentially if you are able to add the rest of the rules without an error 500, then go back into bb-config.php and put back the line for slugs.

    Then the forum should start using slugs.

    To finish up after it’s all working, go find those three extra rewriterule lines I posted much earlier and add those to the list and then you should be 100% done.

    After those extra three lines are in, remember to test the front-page pagination which is what started this entire exercise in the first place, and hopefully they will be error free.


    TrishaM
    Participant

    @trisham

    Ok – thanks! I understand you need to leave – no worries (i know we all have day jobs :) )

    I did add back in the remaining RewriteRule lines, but that triggered the 500 error. I’ll try adding them one by one until I hit the error, and post back which line it is…..


    TrishaM
    Participant

    @trisham

    Well I am THRILLED to report that it finally ALL works as it should!

    The odd part is that I never found any errors when I added the RewriteRule lines back in one by one – it was time consuming but worth it in the end (seems strange that copying & pasting the whole block in at once triggered the 500 error, but doing them one by one did not, but oh well – sometimes it’s just better to not question things too deeply)….

    I even added in the three lines needed for the plugin and had no trouble, so now the page numbers are working perfectly on the front page.

    I can’t thank you enough for all your patience and perseverance with this problem….I just sent you a well-deserved donation via your link on the showcase…….if I were ever going to have kids I’d seriously consider naming my firstborn _ck_ :)


    _ck_
    Participant

    @_ck_

    It is possible whatever editor you were using was inserting some whitespace when you pasted the entire thing before one of the lines. What editor were you using?

    ps. thank you very much for the donation!


    TrishaM
    Participant

    @trisham

    I use TextWrangler, from BareBones software – it’s a free text editor that has a lot of the features of their pay-for text editor, BBEdit (it replaced BBEdit Lite). To the best of my knowledge it’s not supposed to do something like that (pasting whitespace) and I haven’t had trouble in the past, but you never know – it could have been something in the process of copying it from my browser window after running rewrite-rules.php and then pasting it into TextWrangler that added some whitespace….

    I’ll definitely keep that in mind next time I’m copying and pasting anything…….

    And you’re welcome for the donation – as mentioned it was very well deserved! I’m self-employed and have a tiny budget, but I always try to reward plugin and theme developers, especially when they are so nice about providing support that goes way above and beyond the norm as you have :)

Viewing 11 replies - 26 through 36 (of 36 total)

You must be logged in to reply to this topic.