Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Switching to Static URL's...

  1. #1
    tproductions484 is offline x10Hosting Member tproductions484 is an unknown quantity at this point
    Join Date
    Mar 2011
    Posts
    17

    Exclamation Switching to Static URL's...

    Hello.
    I currently have a dynamic URL
    (http://mysite.x10.mx/mybb/member.php...=profile&uid=1)

    And I want to switch to static URL's
    (http://mysite.x10.mx/mybb/user-1.html)

    Yet, all of the php I have trie in my .htaccess in the root of my site (/public_html/.htaccess "is the location of my file") And my forum install (MyBB) is located in: (public_html/mybb/). So, can someone please tell me, to change to static url's, what code do I have to put into my .htaccess for my url's to work as static url's? I get a 404 error when I try one of these:


    PHP Code:
    Options +Multiviews 

    RewriteEngine on
    RewriteBase 
    /
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond 
    %{REQUEST_FILENAME}\.php -f
    RewriteRule 
    ^(.*)$ $1.php 
    PHP Code:
    RewriteEngine on
    RewriteBase 
    /
    RewriteCond %{QUERY_STRING} !mod= [NC]
    RewriteRule ^([^/]+)$ /index.php?mod=$[L
    Please help.

  2. #2
    stpvoice's Avatar
    stpvoice is offline Community Support Rep stpvoice has a brilliant futurestpvoice has a brilliant futurestpvoice has a brilliant future
    Join Date
    Dec 2008
    Location
    United Kingdom
    Posts
    5,939

    Re: Switching to Static URL's...

    Hello,

    As from what you've said I gather your site to be run by a MyBB script, I suggest you consult their support. They will be able to give you more specialist advice.


  3. #3
    tproductions484 is offline x10Hosting Member tproductions484 is an unknown quantity at this point
    Join Date
    Mar 2011
    Posts
    17

    Re: Switching to Static URL's...

    Quote Originally Posted by stpvoice View Post
    Hello,

    As from what you've said I gather your site to be run by a MyBB script, I suggest you consult their support. They will be able to give you more specialist advice.
    Yes, but I do not know all of the optimized settings on x10hosting, and neither would MyBB, so, as one last question, is there any prefix that I have to place before the code or something such as

    PHP Code:
    RewriteBase 
    or would it be

    PHP Code:
    RewriteBase /mybb
    Because the script isn't installed into the root, there is it's own directory... (public_html/mybb/)

  4. #4
    stpvoice's Avatar
    stpvoice is offline Community Support Rep stpvoice has a brilliant futurestpvoice has a brilliant futurestpvoice has a brilliant future
    Join Date
    Dec 2008
    Location
    United Kingdom
    Posts
    5,939

    Re: Switching to Static URL's...

    Hello,

    RewriteBase / should be placed immediately below RewriteEngine On in your .htaccess.


  5. #5
    tproductions484 is offline x10Hosting Member tproductions484 is an unknown quantity at this point
    Join Date
    Mar 2011
    Posts
    17

    Exclamation Re: Switching to Static URL's...

    Okay, my .htaccess is supposed to include this:

    PHP Code:
    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
    </IfModule>

    #
    # 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
            RewriteBase 

        
    RewriteRule ^forum-([0-9]+)\.htmlforumdisplay.php?fid=$[L,QSA]
        
    RewriteRule ^forum-([0-9]+)-page-([0-9]+)\.htmlforumdisplay.php?fid=$1&page=$[L,QSA]

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

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

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

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

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

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

        <
    IfModule mod_env.c>
            
    SetEnv SEO_SUPPORT 1
        
    </IfModule>
    </
    IfModule>

    #
    # 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/javascript text/css text/html text/xml
    </IfModule
    And I still get 404 errors when I try to access pages on the site! But when I remove the code, the site works! So, can someone please edit this code to what would work for MyBB and x10hosting options (such as RewriteBase / needed, as well as maybe other things like that).

    If this helps, MyBB is uploaded into this directory: "public_html/mybb/"
    Do I maybe have to change "RewriteBase /" to "RewriteBase /mybb/"?
    Last edited by tproductions484; 07-20-2011 at 11:01 PM.

  6. #6
    Skizzerz's Avatar
    Skizzerz is offline Contributors Skizzerz will become famous soon enough
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    2,153

    Re: Switching to Static URL's...

    Hello,

    You will need to change it to RewriteBase /mybb/ as you stated above, since your forum is in the /mybb directory.
    Ryan Schmidt | Level 2 Support
    █ 888-X10-9668 - ryan[@]x10hosting.com
    x10Hosting - Giving Away Hosting Since 2004
    Premium Hosting | VPS Services

  7. #7
    tproductions484 is offline x10Hosting Member tproductions484 is an unknown quantity at this point
    Join Date
    Mar 2011
    Posts
    17

    Re: Switching to Static URL's...

    It STILL DOESN'T WORK. I still keep getting 404's. Would I have to change ANY OF THE LINKS OF THIS CODE? Considering that it is installed in public_html/mybb/?

    PHP Code:
    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
    </IfModule>

    #
    # 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]+)\.htmlforumdisplay.php?fid=$[L,QSA]
        
    RewriteRule ^forum-([0-9]+)-page-([0-9]+)\.htmlforumdisplay.php?fid=$1&page=$[L,QSA]

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

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

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

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

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

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

        <
    IfModule mod_env.c>
            
    SetEnv SEO_SUPPORT 1
        
    </IfModule>
    </
    IfModule>

    #
    # 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/javascript text/css text/html text/xml
    </IfModule

  8. #8
    Skizzerz's Avatar
    Skizzerz is offline Contributors Skizzerz will become famous soon enough
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    2,153

    Re: Switching to Static URL's...

    You took out the RewriteBase...

    Should look like the following under the <IfModule mod_rewrite.c> line
    Code:
    RewriteEngine On
    RewriteBase /mybb/
    Ryan Schmidt | Level 2 Support
    █ 888-X10-9668 - ryan[@]x10hosting.com
    x10Hosting - Giving Away Hosting Since 2004
    Premium Hosting | VPS Services

  9. #9
    tproductions484 is offline x10Hosting Member tproductions484 is an unknown quantity at this point
    Join Date
    Mar 2011
    Posts
    17

    Re: Switching to Static URL's...

    Quote Originally Posted by Skizzerz View Post
    You took out the RewriteBase...

    Should look like the following under the <IfModule mod_rewrite.c> line
    Code:
    RewriteEngine On
    RewriteBase /mybb/
    That just gives me a 500 error... OMG. Does x10hosting not support this feature or something? I'm doing exactly what you day.

  10. #10
    Skizzerz's Avatar
    Skizzerz is offline Contributors Skizzerz will become famous soon enough
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    2,153

    Re: Switching to Static URL's...

    Oh, just noticed your first post -- you need to move that .htaccess file into the mybb directory
    Ryan Schmidt | Level 2 Support
    █ 888-X10-9668 - ryan[@]x10hosting.com
    x10Hosting - Giving Away Hosting Since 2004
    Premium Hosting | VPS Services

Closed Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. switching versions?
    By Killjoy116 in forum Free Hosting
    Replies: 1
    Last Post: 10-31-2008, 05:24 AM
  2. Switching from the help center.
    By Corey in forum News and Announcements
    Replies: 4
    Last Post: 06-27-2008, 03:48 AM
  3. Site switching up and down
    By zapperpost in forum Free Hosting
    Replies: 1
    Last Post: 05-29-2008, 05:48 PM
  4. Switching Hosts
    By ukbsktbll in forum Free Hosting
    Replies: 5
    Last Post: 12-31-2007, 04:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers