vBulletin 4, the most powerful community software + vBSEO 3.5, the ultimate SEO solution = Your ultimate platform for 2010 and beyond. Click below to learn more.

Results 1 to 10 of 10

Which .htaccess is correct?

This is a discussion on Which .htaccess is correct? within the Troubleshooting forums, part of the vBSEO SEO Plugin category; Our host continues to have security breeches and our .htaccess file is being replaced with an altered file. I got ...

  1. #1
    Senior Member Sonnie's Avatar
    Real Name
    Sonnie
    Join Date
    May 2006
    Location
    L.A. (Lower Alabama)
    Posts
    208

    Which .htaccess is correct?

    Our host continues to have security breeches and our .htaccess file is being replaced with an altered file.

    I got to looking today and for some reason I have two different .htaccess files and I'm not sure which one is the correct one to use...

    Code:
    Options All -Indexes
    
    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^hometheatershack.com
    RewriteRule (.*) http://www.hometheatershack.com/$1 [R=301,L]
    
    RewriteCond %{HTTP_REFERER} !^http://hometheatershack.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://hometheatershack.com$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.hometheatershack.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.hometheatershack.com$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.snapbug.ws/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.snapbug.ws$ [NC]
    
    RewriteRule .*\.(xls|cal|mpeg|mp3)$ http://hometheatershack.com/display.html [R,NC]
    
    RewriteRule bfdguide/index\.html http://www.hometheatershack.com/forums/bfd.php [L,R=301]
    

    Code:
    RewriteEngine On
    
    RewriteBase /
    
    RewriteCond %{HTTP_HOST} !^hometheatershack.com
    RewriteRule (.*) http://www.hometheatershack.com/forums/$1 [L,R=301]
    
    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 %{REQUEST_FILENAME}index\.php -f
    RewriteRule ^(.*)$ $1index.php [L]
    
    RewriteCond %{QUERY_STRING} !vbseourl=
    RewriteCond %{REQUEST_FILENAME} !chat
    RewriteRule ^(.*\.php)$ vbseo.php?vbseourl=$1&%{QUERY_STRING} [L]
    
    RewriteRule ^$ vbseo.php?vbseourl=index.php [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]
    
    RewriteRule .*\.(xls|cal|mpeg|mp3)$ http://hometheatershack.com/display.html [R,NC]
    
    RewriteRule bfdguide/index\.html http://www.hometheatershack.com/forums/bfd.php [L,R=301]
    

    Is Rewritebase / necessary... or how do I know if it's necessary... or would it hurt to have it in there?

    The second one has more than the first, but I'm not sure what's needed and what's not. :dizzy:

  2. #2
    Senior Member Sonnie's Avatar
    Real Name
    Sonnie
    Join Date
    May 2006
    Location
    L.A. (Lower Alabama)
    Posts
    208
    Actually... I've tried both of these and several variations of each and I cannot get our home page to open... www.hometheatershack.com ... I get the following error:

    Not Found
    The requested URL /vbseo.php was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    Apache/1.3.37 Server at www.hometheatershack.com Port 80

  3. #3
    Senior Member Sonnie's Avatar
    Real Name
    Sonnie
    Join Date
    May 2006
    Location
    L.A. (Lower Alabama)
    Posts
    208
    Okay... I deleted the .htaccess file in public_html and left it in public_html/forums ... is this where it needs to be? I also still need to make sure which one above is correct.

  4. #4
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    24,519
    Hello Sonnie,

    Correct .htaccess is:
    Code:
    # 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
    
    
    RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
    
    RewriteCond %{QUERY_STRING} !vbseourl=
    RewriteCond %{REQUEST_FILENAME} !(admincp/|modcp/|chat|cron)
    RewriteRule ^(.*\.php)$ vbseo.php?vbseourl=$1&%{QUERY_STRING} [L]
    
    RewriteCond %{REQUEST_FILENAME} !\.(jpg|gif)$
    RewriteRule ^(archive/.*)$ vbseo.php?vbseourl=$1&%{QUERY_STRING} [L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !(admincp|modcp|clientscript|cpstyles|images)/
    RewriteRule ^(.+)$ vbseo.php?vbseourl=$1&%{QUERY_STRING} [L]
    
    it should be located in your forums folder.
    Oleg Ignatiuk / Crawlability Inc.
    Sneek Preview Video of the new Control Panel

    vBSEO 3.5 RC2 (Final)- Released for your Evaluation


  5. #5
    Member chick's Avatar
    Real Name
    Denise
    Join Date
    Nov 2006
    Posts
    33
    That should come in some type of instructions with the product. We are not all savvy on this type of thing. I'm not too thrilled right now since I just purchased this after much hype and when I open the zip files NOTHING tells me where to put the htaccess (I have one in the root already) so I didn't know until I read this thread where the one that comes with vbSEO should go.

    Also am I suppose to have special powers and know if this requires an install.php, does it magically show up in my vBulletin ACP?

    For the $$ you get, the least you could do is put some instructions in there for you novice customers.

    I understand where to up the files to, but WHAT, it magically shows up in my CP.

  6. #6
    Senior Member
    Real Name
    Keith Cohen
    Join Date
    Jul 2005
    Location
    Raleigh, NC USA
    Posts
    6,147
    Quote Originally Posted by chick View Post
    That should come in some type of instructions with the product. We are not all savvy on this type of thing. I'm not too thrilled right now since I just purchased this after much hype and when I open the zip files NOTHING tells me where to put the htaccess (I have one in the root already) so I didn't know until I read this thread where the one that comes with vbSEO should go.

    Also am I suppose to have special powers and know if this requires an install.php, does it magically show up in my vBulletin ACP?

    For the $$ you get, the least you could do is put some instructions in there for you novice customers.

    I understand where to up the files to, but WHAT, it magically shows up in my CP.


    Copied directly from the installation instructions that are included in the ZIP:

    A. Upload ALL the files in the 'upload' folder to your forum root folder in BINARY mode.

    Note: Ensure you upload a file named .htaccess (located in your 'upload' folder) to your forum root folder. In some machines, this file is not visible. If this is your case, find the htaccess.txt file in the 'docs' folder and (1) upload it to your root folder first and (2) rename it to .htaccess
    The rest of the steps tell you how to complete the installation....

  7. #7
    Member chick's Avatar
    Real Name
    Denise
    Join Date
    Nov 2006
    Posts
    33
    That is my gripe there are NO instructions at all, in my zip file.

  8. #8
    Senior Member
    Real Name
    Keith Cohen
    Join Date
    Jul 2005
    Location
    Raleigh, NC USA
    Posts
    6,147
    Did you look in the "docs (do not upload)" directory? There is a "readme.html".

  9. #9
    Member chick's Avatar
    Real Name
    Denise
    Join Date
    Nov 2006
    Posts
    33
    Just the folder I would not expect it to be in, since I'm not to use it, 'do not upload'.... great place for it!

    Thanks for your reply Keith, I appreciate it.

  10. #10
    Senior Member
    Real Name
    Keith Cohen
    Join Date
    Jul 2005
    Location
    Raleigh, NC USA
    Posts
    6,147
    The folder is called "docs (do not upload)'. "docs" is the standard abbreviation for Documentation or Documents.

    vBulletin also comes with a Do Not Upload directory. You should have seen it there too.

Similar Threads

  1. Hotlink Protection Tutorial (Apache Server - .htaccess files)
    By NeutralizeR in forum Member Articles
    Replies: 13
    Last Post: 11-20-2008, 04:53 AM
  2. .htaccess problem right off
    By eJM in forum Custom Rewrite Rules
    Replies: 10
    Last Post: 08-01-2006, 11:27 PM
  3. Which .htaccess line is which?
    By eJM in forum General Discussion
    Replies: 5
    Last Post: 07-04-2006, 07:55 AM
  4. Add "www." in .htaccess
    By Jason|Xoxide in forum Custom Rewrite Rules
    Replies: 8
    Last Post: 03-31-2006, 12:54 PM