Skip to:
Content
Pages
Categories
Search
Top
Bottom

Topic slugs & numeric IDs


  • michael3185
    Member

    @michael3185

    I don’t fully grasp the relationship between ‘slugs’ and forum topics, and would appreciate a nod in the right direction.

    I can see that when permalinks are set to None, the forum.php file is fed an ID and then grabs the topic(s). When I originally set up one of the forums I set the permalinks to Name based (pretty..?) and all worked fine. However, I moved the forum into a sub-folder, and changed the URI in the topicmeta DB table, so the forum index page appears in the browser. But, while I can navigate fine with permalinks set to None (ie., topics passed by number), it refuses to work when set to Name.

    I realised this might be the slugs in the DB, and so tried removing one and switching permalinks off/on. It fails to find the topic page. If I set permalinks back to None, it works ok.

    Am I right in assuming it’s using the slugs for topic navigation? If so, is there a way of rebuilding the slugs so that they work within the new sub-folder? (And incidentally, why are they called ‘slugs’..?)

Viewing 7 replies - 1 through 7 (of 7 total)
  • When you run this query, does your old URI show up anywhere?

    SELECT * FROM bb_topicmeta WHERE meta_key=’uri’

    As for the word “slugs”, I’m pretty sure it comes from typesetting. :-)

    http://en.wikipedia.org/wiki/Slug_(typesetting)


    michael3185
    Member

    @michael3185

    That’s what I altered manually johnhiler, through my cPanel. I’ve just checked it, and it correctly points to the forum folder, so the index.php comes up fine. As I say, permalinks of None are fine, but Names aren’t, even though they’re in the tables.

    I had this a few weeks ago with another forum, and setting the URI in the DB fixed it. I may just drop the DB and run the installer to sort it out, as there’s nothing much there yet anyway.


    chrishajer
    Participant

    @chrishajer

    Sounds like there is a conflict between .htaccess files now that the forum is in a subfolder after being moved. Did you update your .htaccess rules for the new folder you installed the forum in?


    michael3185
    Member

    @michael3185

    Ah, that I haven’t. I copied it into the folder. Mind you, it doesn’t seem to have anything defined in it which points to the old path. Here’s the content;

    Options -MultiViews

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^pm/?(.*)$ /my-plugins/bbpm/index.php?$1 [L]
    RewriteRule ^page/([0-9]+)/?$ /index.php?page=$1 [L,QSA]
    RewriteRule ^forum/([^/]+)/page/([0-9]+)/?$ /forum.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^forum/([^/]+)/?$ /forum.php?id=$1 [L,QSA]
    RewriteRule ^forum/?$ / [R=302,L,QSA]
    RewriteRule ^topic/([^/]+)/page/([0-9]+)/?$ /topic.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^topic/([^/]+)/?$ /topic.php?id=$1 [L,QSA]
    RewriteRule ^topic/?$ / [R=302,L,QSA]
    RewriteRule ^tags/([^/]+)/page/([0-9]+)/?$ /tags.php?tag=$1&page=$2 [L,QSA]
    RewriteRule ^tags/([^/]+)/?$ /tags.php?tag=$1 [L,QSA]
    RewriteRule ^tags/?$ /tags.php [L,QSA]
    RewriteRule ^profile/([^/]+)/page/([0-9]+)/?$ /profile.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^profile/([^/]+)/([^/]+)/?$ /profile.php?id=$1&tab=$2 [L,QSA]
    RewriteRule ^profile/([^/]+)/([^/]+)/page/([0-9]+)/?$ /profile.php?id=$1&tab=$2&page=$3 [L,QSA]
    RewriteRule ^profile/([^/]+)/?$ /profile.php?id=$1 [L,QSA]
    RewriteRule ^profile/?$ /profile.php [L,QSA]
    RewriteRule ^view/([^/]+)/page/([0-9]+)/?$ /view.php?view=$1&page=$2 [L,QSA]
    RewriteRule ^view/([^/]+)/?$ /view.php?view=$1 [L,QSA]
    RewriteRule ^rss/?$ /rss.php [L,QSA]
    RewriteRule ^rss/topics/?$ /rss.php?topics=1 [L,QSA]
    RewriteRule ^rss/forum/([^/]+)/?$ /rss.php?forum=$1 [L,QSA]
    RewriteRule ^rss/forum/([^/]+)/topics/?$ /rss.php?forum=$1&topics=1 [L,QSA]
    RewriteRule ^rss/topic/([^/]+)/?$ /rss.php?topic=$1 [L,QSA]
    RewriteRule ^rss/tags/([^/]+)/?$ /rss.php?tag=$1 [L,QSA]
    RewriteRule ^rss/tags/([^/]+)/topics/?$ /rss.php?tag=$1&topics=1 [L,QSA]
    RewriteRule ^rss/profile/([^/]+)/?$ /rss.php?profile=$1 [L,QSA]
    RewriteRule ^rss/view/([^/]+)/?$ /rss.php?view=$1 [L,QSA]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^.*$ /index.php [L]
    </IfModule>

    I have no idea what any of it does!


    chrishajer
    Participant

    @chrishajer

    I am guessing you need to change your

    RewriteBase

      from

    RewriteBase /

      to

    RewriteBase /forum/

    where forum is the name of your subfolder.

    You don’t have to, and shouldn’t really edit the slugs in the database ever.


    michael3185
    Member

    @michael3185

    I just moved it all back out of the sub-folder, and everything’s fine now. For some reasons a new install wouldn’t work in the sub-folder either, but no matter. Thanks guys.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Skip to toolbar