Results 1 to 8 of 8

Moving settings from .htaccess t yhost.conf - failed so far

This is a discussion on Moving settings from .htaccess t yhost.conf - failed so far within the Troubleshooting forums, part of the vBSEO SEO Plugin category; Hi there,im an admin on a fairly large board, and i am under the impression that moving rewrite from .htaccess ...

  1. #1
    Junior Member
    Real Name
    Fredrik Bjorkman
    Join Date
    Dec 2011
    Posts
    7
    Liked
    0 times

    Moving settings from .htaccess t yhost.conf - failed so far

    Hi there,im an admin on a fairly large board, and i am under the impression that moving rewrite from .htaccess to vhost.conf will improve general performance. I´m not, however, 100% sure why this would be a good thing, just read what others say about it.

    I know there has been a lot of writing on this, but i just could not figure this out by reading, so i have to ask.Anyway. There is some other stuff on the server, so i can not go httpd.conf with this, it has to be vhost. k, so i copied the htaccess data, and pasted it into vhost, find it below.

    1. First error was rejection for RewriteBase /vb. This path must be wrong in some way, but i realy don´t know how. Please advice.

    Server error message:
    ---
    Syntax error on line 16 of var/www/vhost/mysite.info/conf/vhost.confRewriteBase: Only valid in per directory config files
    [FAILED]]
    ---
    My line 16 is: RewriteBase /vb

    After that nothing seemed to be working.

    Best regards,
    Franke
    ---------------------------------------------------------------

    php_admin_flag safe_mode off
    # 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 /vb
    RewriteCond %{HTTP_HOST} !^www\.mysite\.infoRewriteRule (.*) http://www.mysite.info/vb/$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|api\.php)
    RewriteRule ^((archive/)?(.*\.php(/.*)?))$ vbseo.php [L,QSA]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !/(admincp|modcp|clientscript|cpstyles|images)/RewriteRule ^(.+)$ vbseo.php [L,QSA]
    Last edited by Franke_rwi; 01-05-2012 at 05:48 AM. Reason: Typos, adding stuff

  2. #2
    vBSEO.com Webmaster Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,111
    Liked
    622 times
    Blog Entries
    4
    Hello ,

    You have error in your code. Please check [How to] Setup www.yourdomain.com or yourdomain.com (www vs. non-www) - With .htaccess 301 redirects for the correct redirect rule.
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  3. #3
    Junior Member
    Real Name
    Fredrik Bjorkman
    Join Date
    Dec 2011
    Posts
    7
    Liked
    0 times
    Well, ok. But that didn´t realy tell me much, so please if you have a moment, try to explain.

    I was under the impression that it was .htaccess OR vhos. This suggests both, so im a little confused. Futhermore, i read another instruction, suggesting that everything from .htaccess should go to vhos.

    Mistake?

  4. #4
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2

  5. #5
    Junior Member
    Real Name
    Fredrik Bjorkman
    Join Date
    Dec 2011
    Posts
    7
    Liked
    0 times
    Ok, i see. So if i put the pasted code in my vhost, is it likely to work?
    Or do the red parts (or any other part) also need any modificion? The green part was present when i started my modding quest.

    Best regards,

    //Fredrik
    -----------------------

    <Directory "/var/www/vhosts/mysite.info/httpdocs">
    php_admin_flag safe_mode off
    </Directory>


    RewriteEngine On


    RewriteCond %{HTTP_HOST} !^www\.mysite\.info
    RewriteRule (.*) http://www.mysite.info/vb/$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|api\.php)
    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]

  6. #6
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    The rules should be within the Directory tags. Randomly out in the open is invalid.

  7. #7
    Junior Member
    Real Name
    Fredrik Bjorkman
    Join Date
    Dec 2011
    Posts
    7
    Liked
    0 times
    Perfect. But are they correct?

  8. #8
    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 Fredrik,

    Yes, they are. To be more specific, use this:

    <Directory "/var/www/vhosts/mysite.info/httpdocs">
    php_admin_flag safe_mode off

    RewriteEngine On

    RewriteCond %{HTTP_HOST} !^www\.mysite\.info
    RewriteRule (.*) mysite.info - Mysite Resources and Information.vb/$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|api\.php)
    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>
    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. I need a .httaccess (.conf) sample for changing my urls.
    By plastique in forum URL Rewrite Settings
    Replies: 3
    Last Post: 02-12-2011, 08:41 PM
  2. Moving .htaccess to httpd.conf - speed increase?
    By tavenger5 in forum General Discussion
    Replies: 5
    Last Post: 07-12-2009, 01:41 PM
  3. Moving .htaccess settings to httpd.conf
    By rinkrat in forum Troubleshooting
    Replies: 1
    Last Post: 02-10-2008, 11:48 AM
  4. Help with moving from .htaccess to httpd.conf
    By MRBarto in forum Troubleshooting
    Replies: 15
    Last Post: 12-10-2007, 04:16 PM
  5. Moving info from .htaccess to httpd.conf
    By Tigermoth in forum Troubleshooting
    Replies: 11
    Last Post: 01-01-2007, 07:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •