Results 1 to 12 of 12

Moving info from .htaccess to httpd.conf

This is a discussion on Moving info from .htaccess to httpd.conf within the Troubleshooting forums, part of the vBSEO SEO Plugin category; Hi, My server load averages increase from 0.5 to up to 14 after enabling vbseo . Browsing the site I've ...

  1. #1
    Junior Member
    Join Date
    Jan 2006
    Posts
    6
    Liked
    0 times

    Moving info from .htaccess to httpd.conf

    Hi,

    My server load averages increase from 0.5 to up to 14 after enabling vbseo.

    Browsing the site I've seen that one method of reducing server load would be to move the mod rewrite info from .htaccess to httpd.conf.

    Could someone let me know how to do this. Here's what's in my .htaccess file...

    # Comment the following line (add '#' at the beginning)
    # to disable mod_rewrite functions.
    # Please note: you still need to disable the hack in
    # the vBSEO control panel to stop url rewrites.
    RewriteEngine On
    # Some servers require the Rewritebase directive to be
    # enabled (remove '#' at the beginning to activate)
    # Please note: when enabled, you must include the path
    # to your root vB folder (i.e. RewriteBase /forums)
    #RewriteBase /
    RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsit emap.php?sitemap=$1 [L]
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteCond %{REQUEST_FILENAME} (admincp|modcp|clientscript|cpstyles|images)/
    RewriteRule ^(.*)$ $1 [L]
    RewriteCond %{QUERY_STRING} !vbseourl=
    RewriteCond %{REQUEST_FILENAME} !chat
    RewriteRule ^(.*\.php)$ vbseo.php?vbseourl=$1&%{QUERY_STRING} [L]
    RewriteRule ^(archive/.*)$ vbseo.php?vbseourl=$1&%{QUERY_STRING} [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)$ vbseo.php?vbseourl=$1&%{QUERY_STRING} [L]

    Thanks,

    Chris

  2. #2
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    Hello Chris,

    you can insert exactly the same code in your httpd.conf in <Directory> section referred to your forums folder:
    <Directory /path/to/forum>
    RewriteEngine On
    RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsit emap.php?sitemap=$1 [L]
    ....
    </Directory>
    Do not forget to restart apache and remove .htaccess after that.
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  3. #3
    Junior Member
    Join Date
    Jan 2006
    Posts
    6
    Liked
    0 times
    Hi,

    Thanks, I get the following error when I do this and try to restart httpd:

    Starting httpd: Syntax error on line 1040 of /etc/httpd/conf/httpd.conf:
    RewriteRule: bad flag delimiters

  4. #4
    Junior Member
    Join Date
    Jan 2006
    Posts
    6
    Liked
    0 times
    OK. I removed all the comments out of the info and it now restarts but it doesn't seem to be having any effect. Just acts like it does when I remove .htaccess from the forum directory. When I put .htaccess back up, it works again. Seems like it's ignoring my changes to httpd.conf.

  5. #5
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    Hi,

    make sure that you include *exactly* the same code as it is in .htaccess file (vbulletin inserts spaces in the code posted here on forums for formatting purposes)
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  6. #6
    Junior Member
    Join Date
    Jan 2006
    Posts
    6
    Liked
    0 times
    Does it matter where in httpd.conf I put it? I'm just adding a new <Directory>...</Directory> at the end of the file.

    Chris

  7. #7
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    Hello Chris,

    it is usually added within <Virtualhost> section for the corresponding domain.
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  8. #8
    Senior Member
    Real Name
    Holger
    Join Date
    Oct 2005
    Location
    Frankfurt / Germany
    Posts
    611
    Liked
    1 times
    example

    Code:
    ############
    # Example #
    ############
    ##############################################################
    
    <VirtualHost server-ip>
    DocumentRoot /to/your/forum
    ServerName your domainname
    <Directory "/to/your/forum">
    
    
    RewriteEngine On
    #RewriteBase /
    RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
     
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteCond %{REQUEST_FILENAME} (admincp|modcp|clientscript|cpstyles|images)/
    RewriteRule ^(.*)$ $1 [L]
     
    RewriteCond %{QUERY_STRING} !vbseourl=
    RewriteCond %{REQUEST_FILENAME} !chat
    RewriteRule ^(.*\.php)$ vbseo.php?vbseourl=$1&%{QUERY_STRING} [L]
     
    RewriteRule ^(archive/.*)$ vbseo.php?vbseourl=$1&%{QUERY_STRING} [L]
     
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)$ vbseo.php?vbseourl=$1&%{QUERY_STRING} [L]
     
    </Directory>
    #
    #################################################################

  9. #9
    Junior Member
    Join Date
    Jan 2006
    Posts
    6
    Liked
    0 times
    Thanks for the info. I've altered my /etc/httpd/conf/httpd.conf file but when I restart httpd I get the following error message:

    Starting httpd: [Sun Mar 12 06:11:12 2006] [warn] VirtualHost 216.127.90.114:80 overlaps with VirtualHost 216.127.90.114:0, the first has precedence, perhaps you need a NameVirtualHost directive

    I've looked through the httpd.conf file and there are no other VirutalHost sections that are not commented out.

  10. #10
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    PM sent
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  11. #11
    Junior Member
    Join Date
    Jan 2006
    Posts
    6
    Liked
    0 times
    Thanks Oleg. I've worked out how to do it. My httpd.conf info for that site actually resides in a different file in the /etc/httpd/conf directory...

    Unfortunately, its not helped with the load averages. Currently at 37 and climbing. I'm going to switch off vbseo again... Perhaps my server just isn't up to it... p4 2.6 with 1gb ram...

    Chris

  12. #12
    vBSEO Staff Juan Muriente's Avatar
    Real Name
    Juan Carlos Muriente
    Join Date
    Jun 2005
    Location
    Puerto Rico
    Posts
    14,267
    Liked
    558 times
    I know it's been a while, but do you have updates on your loads issue? A couple of newer vBSEO versions have been released since then and I was curious.

    Thanks
    Juan Muriente / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


Similar Threads

  1. Replies: 1
    Last Post: 03-20-2006, 03:50 PM
  2. Replies: 2
    Last Post: 02-24-2006, 11:11 AM
  3. Rewrite rules in httpd.conf or .htaccess?
    By porschinho in forum General Discussion
    Replies: 2
    Last Post: 12-28-2005, 06:27 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
  •