Need a little helpRSS

5 replies

Last post Apr 13, 2009 06:14 PM by ruslany

  • Need a little help

    Apr 11, 2009 11:25 PM|Howman1976|LINK

    Ok i am slowly figuring out the url rewrite but could use some help.  i am prity much a beginer this is where i am at Trying to make my forum software (MyBB) SEF now i have the  .htaccess file that came with mybb and i can import htaccess and i get 18 rewrite rules so i am thinking now what just doing that does not work.  Now just messing around i went got a link from my site(http://localhost/forumdisplay.php?fid=2) and put it in the user friendy url and click creat corresponding redirect rule and ok  now doing it the way works

    this is the htaccess that came with mybb i import and get 18 rewrite rules but no redirect rules so how would i get redirect rules from these

    Options -MultiViews +FollowSymlinks -Indexes

    # If mod_security is enabled, attempt to disable it.
    # - Note, this will work on the majority of hosts but on
    #   MediaTemple, it is known to cause random Internal Server
    #   errors. For MediaTemple, please remove the block below
    <IfModule mod_security.c>
     # Turn off mod_security filtering.
     SecFilterEngine Off

     # The below probably isn't needed, but better safe than sorry.
     SecFilterScanPOST Off

    # MyBB "search engine friendly" URL rewrites
    # - Note, for these to work with MyBB please make sure you have
    #   the setting enabled in the Admin CP and you have this file
    #   named .htaccess
    <IfModule mod_rewrite.c>
     RewriteEngine on
     RewriteRule ^forum-([0-9]+).html forumdisplay.php?fid=$1 [L,QSA]
     RewriteRule ^forum-([0-9]+)-page-([0-9]+).html forumdisplay.php?fid=$1&page=$2 [L,QSA]

     RewriteRule ^thread-([0-9]+).html showthread.php?tid=$1 [L,QSA]
     RewriteRule ^thread-([0-9]+)-page-([0-9]+).html showthread.php?tid=$1&page=$2 [L,QSA]
     RewriteRule ^thread-([0-9]+)-lastpost.html showthread.php?tid=$1&action=lastpost [L,QSA]
     RewriteRule ^thread-([0-9]+)-nextnewest.html showthread.php?tid=$1&action=nextnewest [L,QSA]
     RewriteRule ^thread-([0-9]+)-nextoldest.html showthread.php?tid=$1&action=nextoldest [L,QSA]
     RewriteRule ^thread-([0-9]+)-newpost.html showthread.php?tid=$1&action=newpost [L,QSA]
     RewriteRule ^thread-([0-9]+)-post-([0-9]+).html showthread.php?tid=$1&pid=$2 [L,QSA]

     RewriteRule ^post-([0-9]+).html showthread.php?pid=$1 [L,QSA]

     RewriteRule ^announcement-([0-9]+).html announcements.php?aid=$1 [L,QSA]

     RewriteRule ^user-([0-9]+).html member.php?action=profile&uid=$1 [L,QSA]

     RewriteRule ^calendar-([0-9]+).html calendar.php?calendar=$1 [L,QSA]
     RewriteRule ^calendar-([0-9]+)-year-([0-9]+).html calendar.php?action=yearview&calendar=$1&year=$2 [L,QSA]
     RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+).html calendar.php?calendar=$1&year=$2&month=$3 [L,QSA]
     RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)-day-([0-9]+).html calendar.php?action=dayview&calendar=$1&year=$2&month=$3&day=$4 [L,QSA]
     RewriteRule ^calendar-([0-9]+)-week-(n?[0-9]+).html calendar.php?action=weekview&calendar=$1&week=$2 [L,QSA]

     RewriteRule ^event-([0-9]+).html calendar.php?action=event&eid=$1 [L,QSA]

     <IfModule mod_env.c>
      SetEnv SEO_SUPPORT 1

    # If Apache is compiled with built in mod_deflade/GZIP support
    # then GZIP Javascript, CSS, HTML and XML so they're sent to
    # the client faster.
    <IfModule mod_deflate.c>
     AddOutputFilterByType DEFLATE application/x-javascript text/css text/html text/xml

    would i have to go and find all the links and input one bye or could i use some site map software and get the links from there and input them i just do not know what comes next.

    can any one help

  • Re: Need a little help

    Apr 13, 2009 01:18 PM|ruslany|LINK

    It looks like the rules have been imported successfully, but the application is still not configured to work with search engine friendly url's. I am not familiar with MyBB, but I assume that there is a page in its admin control panel where you can turn on a setting called similar to "search engine friendly urls". After that the application should generate all its links in a new format.

    I also noticed that .htaccess file has a directive to set SEO_SUPPORT environment variable. May be MyBB requires this environment variable to be set to 1 in order to work with SEF URLs.


  • Re: Need a little help

    Apr 13, 2009 04:03 PM|Howman1976|LINK

    yes there is a drop down box in mybb 3 options (Automatic detection, enabled, disable) now if i leave it at automatic detection mybb works normaly now if i go enabled i get

    404 - File or directory not found.

    The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

    disabled board works normaly

    this happens with the imported .htaccess file 

    now if i cut and past link http://localhost/MyBB/forumdisplay.php?fid=2 and go to the rewrite add rule to user friendly url click on Create corresponding redirect rule click ok i get one redriect rule and one rewrite rule now if i go back and use ither automatic or disable the board partly works images are all broken and some of the forum links don't contenue to the end forum

    i get these when i add http://localhost/MyBB/forumdisplay.php?fid=2

    redriect rule {C:1}

    rewrite rule forumdisplay.php?fid={R:1}

    and enable gives me the 404 again

  • Re: Need a little help

    Apr 13, 2009 04:23 PM|ruslany|LINK

    When you import the rewrite rules from .htacess file, where do you import them to? Is it to the web.config file located at the web site root folder or at the MyBB folder? It looks to me that the rules should be imported into the web.config file inside of MyBB folder.

  • Re: Need a little help

    Apr 13, 2009 05:08 PM|Howman1976|LINK

    well i guess the rewrite makes the web.config file in the wwwroot folder by defult my forum is in a folder called mybb in the wwwroot folder so i just moved the file from wwwroot to mybb and that seamed to have fixed it but now if i go back to the rewrite rule in iis 7 there is nothing there will that mess any thing up going to play around abit and see what happen why is when somthing goes wrong it always somthing small move one file from one folder to another and it works go figure 

    Any how thank you for your help I appericiate it very much and you replyed quickly i enjoyed that also

    did i say thank you if not Thank You Very Much     Any more problams i will post here and thank you once again 

  • Re: Need a little help

    Apr 13, 2009 06:14 PM|ruslany|LINK

    In IIS manager, select the MyBB folder in the left hand side tree view. After that open the URL Rewrite UI. You should see the imported rules there.

    As with many of the other IIS settings, there is a significance in where the url rewrite configuration settings are defined. Rewrite rules can be defined on a server, site and folder levels.