Results 1 to 6 of 6
Like Tree1Likes
  • 1 Post By Andrés Durán Hewitt

Move .htaccess rules into httpd.conf

This is a discussion on Move .htaccess rules into httpd.conf within the General Discussion forums, part of the vBulletin SEO Discussion category; Please can an expert to check out the following files if they are okay I want to write them .htaccess ...

  1. #1
    Member nikosb's Avatar
    Real Name
    Nikos
    Join Date
    Jan 2009
    Location
    GREECE
    Posts
    93
    Liked
    0 times

    Move .htaccess rules into httpd.conf

    Please can an expert to check out the following files if they are okay

    I want to write them .htaccess in httpd.conf

    I use plesk to dedicated server
    thanks

    root directory

    Code:
    <Directory /var/www/vhosts/supa.gr/httpdocs>
    
    # 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 /
    
    #RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com
    #RewriteRule (.*) http://www.yourdomain.com/forums/$1 [L,R=301]
    
    RewriteRule ^forums/((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ forums/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
    
    RewriteCond %{REQUEST_URI} !(admincp/|modcp/|cron|vbseo_sitemap)
    RewriteRule ^forums/((archive/)?(.*\.php(/.*)?))$ forums/vbseo.php [L,QSA]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !/(admincp|modcp|clientscript|cpstyles|images)/
    RewriteRule ^(.+)$ forums/vbseo.php [L,QSA]
    </Directory>
    forum directory
    Code:
    <Directory /var/www/vhosts/supa.gr/httpdocs/forums>
    
    # 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 /forums/
    
    #RewriteCond %{HTTP_HOST} !^www\.supa\.gr
    #RewriteRule (.*) http://www.supa.gr/forums/$1 [L,R=301]
    
    RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
    
    RewriteCond %{REQUEST_URI} !(admincp/|modcp/|cron|vbseo_sitemap)
    RewriteRule ^((archive/)?(.*\.php(/.*)?))$ vbseo.php [L,QSA]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !/(admincp|modcp|clientscript|cpstyles|images)/
    RewriteRule ^(.+)$ vbseo.php [L,QSA]
    
    </Directory>

  2. #2
    vBSEO Staff Andrés Durán Hewitt's Avatar
    Real Name
    Andrés Durán
    Join Date
    Jul 2009
    Location
    Costa Rica
    Posts
    3,393
    Liked
    411 times
    Blog Entries
    1
    Hello Nikos,

    I would use in root directory:

    Code:
    <Directory /var/www/vhosts/supa.gr/httpdocs>
    
    # 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 /
    
    RewriteCond %{HTTP_HOST} !^www\.supa\.gr$
    RewriteRule ^(.*)$ http://www.supa.gr/$1 [L,R=301]
    
    RewriteCond %{REQUEST_URI} !(admincp/|modcp/|cron|vbseo_sitemap)
    RewriteRule ^forums/((archive/)?(.*\.php(/.*)?))$ forums/vbseo.php [L,QSA]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !/(admincp|modcp|clientscript|cpstyles|images)/
    RewriteRule ^(.+)$ forums/vbseo.php [L,QSA]
    </Directory>
    The first ones highlighted will redirect URLs non-www to URLs www.

    Changing in the last one highlighted line %{REQUEST_FILENAME} for %{REQUEST_URI} wouldn't make vulnerable your admincp directory and will make it inaccessible in case you want to use .htaccess protection.

    And in "forums/" directory:

    Code:
    <Directory /var/www/vhosts/supa.gr/httpdocs/forums>
    
    # 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 /forums/
    
    RewriteCond %{HTTP_HOST} !^www\.supa\.gr
    RewriteRule (.*) http://www.supa.gr/forums/$1 [L,R=301]
    
    RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
    
    RewriteCond %{REQUEST_URI} !(admincp/|modcp/|cron|vbseo_sitemap)
    RewriteRule ^((archive/)?(.*\.php(/.*)?))$ vbseo.php [L,QSA]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !/(admincp|modcp|clientscript|cpstyles|images)/
    RewriteRule ^(.+)$ vbseo.php [L,QSA]
    
    </Directory>
    The highlighted rules will redirect URLs non-www to URLs www.
    Andrés Durán / Crawlability Inc.
    ˇvBSEO 3.6.0 GOLD Liberado!
    Inaugurando el NUEVO vBSEO Sitemap Generator 3.0. - ˇAHORA disponible para Clientes de vBSEO!

    Síguenos en: Facebook | Síguenos en: Twitter


  3. #3
    Member nikosb's Avatar
    Real Name
    Nikos
    Join Date
    Jan 2009
    Location
    GREECE
    Posts
    93
    Liked
    0 times
    thanks Andrés

  4. #4
    vBSEO Staff Andrés Durán Hewitt's Avatar
    Real Name
    Andrés Durán
    Join Date
    Jul 2009
    Location
    Costa Rica
    Posts
    3,393
    Liked
    411 times
    Blog Entries
    1
    You're welcome!
    Andrés Durán / Crawlability Inc.
    ˇvBSEO 3.6.0 GOLD Liberado!
    Inaugurando el NUEVO vBSEO Sitemap Generator 3.0. - ˇAHORA disponible para Clientes de vBSEO!

    Síguenos en: Facebook | Síguenos en: Twitter


  5. #5
    Member nikosb's Avatar
    Real Name
    Nikos
    Join Date
    Jan 2009
    Location
    GREECE
    Posts
    93
    Liked
    0 times
    upload the .htaccess in httpd.conf and I get the error

    Code:
    Generating new Apache configuration on host <dedicated.supa.gr> failed  because the following error(s) occurred:
    
    Syntax error on line 44 of  /var/www/vhosts/supa.gr/conf/vhost.conf:
    RewriteRule: bad argument line  '^((urllist|sitemap_).*\\.(xml|txt)(\\.gz)?)$'
    
    
    Please fix error(s) in  templates of Apache configuration and retry generating the configuration  file.
    any ideas?

  6. #6
    vBSEO Staff Andrés Durán Hewitt's Avatar
    Real Name
    Andrés Durán
    Join Date
    Jul 2009
    Location
    Costa Rica
    Posts
    3,393
    Liked
    411 times
    Blog Entries
    1
    Hello Nikos,

    Seems that this RewriteRule has been corrupted:

    Code:
    RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
    You likely have someting like this:

    Code:
    RewriteRule ^((urllist|sitemap_).*\\.(xml|txt)(\\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
    Please try reverting it back to:

    Code:
    RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
    Andrés Durán / Crawlability Inc.
    ˇvBSEO 3.6.0 GOLD Liberado!
    Inaugurando el NUEVO vBSEO Sitemap Generator 3.0. - ˇAHORA disponible para Clientes de vBSEO!

    Síguenos en: Facebook | Síguenos en: Twitter


Similar Threads

  1. vBulletin 4.x How to Move .htaccess rules into httpd.conf via SSH
    By newsoftw in forum Troubleshooting
    Replies: 8
    Last Post: 09-17-2010, 04:12 PM
  2. Move .htaccess rules into httpd.conf
    By jarod1981® in forum General Discussion
    Replies: 2
    Last Post: 07-25-2010, 12:39 AM
  3. move rewrite rules from .htaccess to httpd.conf
    By webgroup in forum Troubleshooting
    Replies: 11
    Last Post: 10-08-2008, 05:25 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
  •