Results 1 to 7 of 7

rewrite rules to httpd.conf: How?

This is a discussion on rewrite rules to httpd.conf: How? within the General Discussion forums, part of the vBSEO SEO Plugin category; Hi ! Sorry for this newbie question. If i want have the rewrites rules working from httpd.conf all what i ...

  1. #1
    Junior Member
    Real Name
    Walter
    Join Date
    Dec 2005
    Location
    Argentine
    Posts
    8
    Liked
    0 times

    rewrite rules to httpd.conf: How?

    Hi !

    Sorry for this newbie question. If i want have the rewrites rules working from httpd.conf all what i need is move the content from the htaccess there? Or i need include some extra-rules to the config file?
    Where i can find instructions to do that?

    Thanx !

  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 Acido,

    the rewrite rules inserted into httpd.conf are slightly different from the ones in .htaccess.

    They may be different depending on server configuration, but here is an example of directives to include into a corresponding <VirtualHost> section:
    RewriteEngine On

    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME}index.php -f
    RewriteRule ^(/forum.*)/$ $1/index.php?%{QUERY_STRING} [L]

    RewriteRule ^/forum/(sitemap.*\.(xml|txt)(\.gz)?)$ /forum/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

    RewriteCond %{REQUEST_FILENAME} /forum/(admincp|modcp|clientscript|cpstyles|images)/
    RewriteRule ^(.*)$ $1 [L]

    RewriteCond %{QUERY_STRING} !vbseourl=
    RewriteRule ^/forum/(.*\.php)$ /forum/vbseo.php?vbseourl=$1&%{QUERY_STRING} [L]

    RewriteRule ^/forum/(archive/.*)$ /forum/vbseo.php?vbseourl=$1&%{QUERY_STRING} [L]

    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
    RewriteRule ^/forum/(.+)$ /forum/vbseo.php?vbseourl=$1&%{QUERY_STRING} [L]
    Replace "/forum" with vB subfolder name ("/' when vB is in root)
    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
    Real Name
    Walter
    Join Date
    Dec 2005
    Location
    Argentine
    Posts
    8
    Liked
    0 times
    thanx Oleg, but is not working yet. All the url's end is 404 error.

    What if try with absoluthe paths? can you give me the sintaxis but usinf full path instead of /forums ?
    My htaccess works perfect. My trouble is on the httpd.conf and i'm not sure where start to check the trouble :(

    My instalation is in :www.mydomain.com/foros
    (vb is not in root)
    Last edited by Acido; 12-23-2005 at 07:31 PM.

  4. #4
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    Basically, it is not required to specify full paths, you just need to replace "/forum" with "/foros".

    Did you restarted Apache after httpd.conf modification? (this is a required step)
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  5. #5
    Junior Member
    Real Name
    Walter
    Join Date
    Dec 2005
    Location
    Argentine
    Posts
    8
    Liked
    0 times
    Quote Originally Posted by Oleg Ignatiuk
    Basically, it is not required to specify full paths, you just need to replace "/forum" with "/foros".

    Did you restarted Apache after httpd.conf modification? (this is a required step)
    Still with error 404 on all Url's
    Yes, we restart apache on each httpd.conf modification. I send you a PM to chek my personal config, ok ?

  6. #6
    Junior Member
    Real Name
    Walter
    Join Date
    Dec 2005
    Location
    Argentine
    Posts
    8
    Liked
    0 times
    Well here is my solution for httpd.conf :

    RewriteEngine on
    RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
    RewriteRule .* - [F]
    <Directory /full-path-to-vbroot>
    Options +FollowSymLinks
    RewriteEngine On
    RewriteRule \.0([0-9]+)\.html$ /full-path-to-vbroot/forumdisplay.php?f=$1&%{QUERY_STRING} [L]
    RewriteRule \.([0-9]+)\.html$ /full-path-to-vbroot/showthread.php?t=$1&%{QUERY_STRING} [L]
    RewriteRule ^(sitemap.*\.(xml|txt)(\.gz)?)$ /full-path-to-vbroot/vbseo_sitemap/vbseo_getsitemap.p$
    RewriteCond %{QUERY_STRING} !vbseourl=
    RewriteRule ^(.*\.php)$ /full-path-to-vbroot/vbseo.php?vbseourl=$1&%{QUERY_STRING} [L]
    RewriteRule ^(archive/.*)$ /full-path-to-vbroot/vbseo.php?vbseourl=$1&%{QUERY_STRING} [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)$ /full-path-to-vbroot/vbseo.php?vbseourl=$1&%{QUERY_STRING} [L]
    </Directory>
    where /full-path-to-vbroot is replaced with the full server path to my vbulletin root folder.

    Al running fine now

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


Similar Threads

  1. Syntax for Custom Rewrite Rules
    By Joe Ward in forum Custom Rewrite Rules
    Replies: 33
    Last Post: 02-10-2011, 09:49 PM
  2. vBSEO 2.0 RC7 Released
    By Juan Muriente in forum vBSEO Announcements
    Replies: 17
    Last Post: 09-09-2005, 12:00 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
  •