Results 1 to 12 of 12

htaccess problem

This is a discussion on htaccess problem within the General Discussion forums, part of the vBSEO SEO Plugin category; Currently my htaccess is working in my forums directory, for example if I type in vBulletin SEO Forums - Search ...

  1. #1
    Senior Member
    Real Name
    Matt
    Join Date
    May 2006
    Posts
    973
    Liked
    4 times

    htaccess problem

    Currently my htaccess is working in my forums directory, for example if I type in vBulletin SEO Forums - Search Engine Optimization Plugin for vBulletin that will redirect me to Gamerz Needs - For All Your Gaming Needs!


    However my htaccess file got changed for Gamerz Needs So now I'm getting a lot of errors from people trying to access files that are no longer there, i want to redirect anything that people enter for http://www.gamerzneeds.net/ (what ever they enter here wrong) to go to Gamerz Needs


    I was trying to stop hotlinking, and i think cpanel may have got rid of my working one.

    so here is what i now have.

    # -FrontPage-

    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthName Gamerz Needs
    AuthUserFile /home/gamerzne/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/gamerzne/public_html/_vti_pvt/service.grp


    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^http://gamerzneeds.net/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://gamerzneeds.net$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.gamerzneeds.net/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.gamerzneeds.net$ [NC]
    RewriteRule .*\.(jpg|jpeg|gif|bmp|png)$ http://www.gamerzneeds.net/forums/pic.jpg [R,NC]
    Thanks
    Last edited by hornstar6969; 12-21-2008 at 09:22 PM.

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

    to perform redirects for all URLs like:
    Code:
    http://www.gamerzneeds.net/wrongurl.html
    TO:
    Code:
    http://www.gamerzneeds.net/
    You should add the following to the bottom of your root .htaccess:
    Code:
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !forums/
    RewriteRule .* http://www.gamerzneeds.net/ [L,R=301]

  3. #3
    Senior Member
    Real Name
    Matt
    Join Date
    May 2006
    Posts
    973
    Liked
    4 times
    Thankyou, that works.


    do you mind explaining what each part means so I maybe able to learn a bit more.

    Thanks

  4. #4
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,741
    Liked
    168 times
    Sure:
    1. the first line means "if requested file doesn't exists"..
    2. the second line means "if requested folder doesn't exists"..
    3. the thirs line means "requested URL doesn't point to forums/ folder"..
    4. last line means "if ALL conditions above are met, redirect to homepage"


  5. #5
    Senior Member
    Real Name
    Matt
    Join Date
    May 2006
    Posts
    973
    Liked
    4 times
    Line 3: Does that mean if I have a folder called /matt then it will now get redirected to the home directory as it is not the forums folder

    Or does it not work like that? and why?

    Thanks

  6. #6
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,741
    Liked
    168 times
    Yes, it means that when you request http://www.domain.com/matt/ and /matt/ folder exists at your host, the redirect will not be performed.

  7. #7
    Senior Member
    Real Name
    Matt
    Join Date
    May 2006
    Posts
    973
    Liked
    4 times
    Just an update: Many changes have occured since this thread. can you take a look at my htaccess file now, and see what changes I should make for this to work again.

    Code:
    RewriteEngine On 
    RewriteRule ^([0-9]+)$ forums/register.php?referrerid=$1 [L]
    RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ forums/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
    
    RewriteRule ^vote-([0-9]*).html index.php?page=Vote&id=$1 [L,NS]
    RewriteRule ^poll-([0-9]*).html index.php?page=Poll&id=$1 [L,NS]
    RewriteRule ^poll-([0-9]*)-(.*).html index.php?page=Poll&id=$1 [L,NS]
    RewriteRule ^poll.reportcomment.([0-9]*)-([0-9]*).html index.php?page=Poll&id=$2&op=reportcomment&commentid=$1 [L,NS]
    
    RewriteRule ^polls.html index.php?page=Polls [L,NS]
    RewriteRule ^login.html index.php?page=Login [L,NS]
    RewriteRule ^changepw.html index.php?page=Password [L,NS]
    RewriteRule ^activate/(.*) activate.php?key=$1 [L,NS]
    RewriteRule ^archive-([^/]*)-([^/]*).html index.php?page=Archive&archive_month=$1&tag=$2 [L,NS]
    RewriteRule ^archive-([^/]*).html index.php?page=Archive&archive_month=$1 [L,NS]
    RewriteRule ^archive.html index.php?page=Archive [L,NS]
    
    RewriteRule ^faq-([0-9]*)-(.*).html index.php?page=FAQ&id=$1 [L,NS]
    
    RewriteRule ^articles.html index.php?page=Articles [L,NS]
    RewriteRule ^article-([0-9]*).html index.php?page=Articles&action=showarticle&id=$1 [L,NS]
    RewriteRule ^article-([0-9]*)-(.*).html index.php?page=Articles&action=showarticle&id=$1 [L,NS]
    RewriteRule ^articlenav-(.*)-page-(.*).html index.php?page=Articles&action=showarticle&id=$1&nav=$2 [L,NS]
    RewriteRule ^articletype-(.*)-(.*).html index.php?page=Articles&action=cat&type=$1&p=$2 [L,NS]
    RewriteRule ^articlesearch.html index.php?page=Search&exec=Search&t=articles [L,NS]
    RewriteRule ^articles-(.*).html index.php?page=Articles&action=cat&type=$1 [L,NS]
    RewriteRule ^([^/]*)-([0-9]*)-articlenav.html index.php?page=Articles&action=cat&type=$1&nav=$2 [L,NS]
    RewriteRule ^([^/]*)-([0-9]*)-articlenav-(.*).html index.php?page=Articles&action=cat&type=$1&nav=$2&p=$3 [L,NS]
    RewriteRule ^article.reportcomment.([0-9]*)-([0-9]*).html index.php?page=Articles&action=showarticle&id=$2&op=reportcomment&commentid=$1 [L,NS]
    
    RewriteRule ^cheats.html index.php?page=Cheats [L,NS]
    RewriteRule ^cheatlist-(.*)-(.*)-(.*).html index.php?page=Cheats&start=$1&cat=$2&nav=$3 [L,NS]
    RewriteRule ^cheat-([0-9]*)-(.*).html index.php?page=Cheats&action=show&game=$1&platform=$2 [L,NS]
    
    RewriteRule ^companylist-(.*)-(.*).html index.php?page=Companies&start=$1&nav=$2 [L,NS]
    RewriteRule ^company-(.*).html index.php?page=Companies&action=show&t=$1 [L,NS]
    RewriteRule ^companies.html index.php?page=Companies [L,NS]
    
    RewriteRule ^linklist-([0-9]*)-([0-9]*).html index.php?page=Links&action=cat&cat_id=$1&nav=$2 [L,NS]
    RewriteRule ^link-([0-9]*).html index.php?page=Links&action=out&id=$1 [L,NS]
    RewriteRule ^links.html index.php?page=Links [L,NS]
    RewriteRule ^linkcat-([0-9]*).html index.php?page=Links&action=cat&cat_id=$1 [L,NS]
    RewriteRule ^linknav-([0-9]*)-([0-9]*).html index.php?page=Links&action=cat&cat_id=$1&nav=$2 [L,NS]
    RewriteRule ^([0-9]*)-([0-9]*)-linknav-(.*).html index.php?page=Links&action=cat&cat_id=$1&nav=$2&orderby=$3 [L,NS]
    RewriteRule ^linksearch.html index.php?page=Search&exec=Search&t=links [L,NS]
    
    RewriteRule ^videolist-(.*)-(.*).html index.php?page=Video&action=cat&cat_id=$1&nav=$2 [L,NS]
    RewriteRule ^video-([0-9]*).html index.php?page=Video&action=showvideo&id=$1 [L,NS]
    RewriteRule ^video-([0-9]*)-(.*).html index.php?page=Video&action=showvideo&id=$1 [L,NS]
    RewriteRule ^video.html index.php?page=Video [L,NS]
    RewriteRule ^videos.html index.php?page=Video [L,NS]
    RewriteRule ^videocat-([0-9]*).html index.php?page=Video&action=cat&cat_id=$1 [L,NS]
    RewriteRule ^([0-9]*)-([0-9]*)-videonav.html index.php?page=Video&action=cat&cat_id=$1&nav=$2 [L,NS]
    RewriteRule ^video.reportcomment.([0-9]*)-([0-9]*).html index.php?page=Video&action=showvideo&id=$2&op=reportcomment&commentid=$1 [L,NS]
    RewriteRule ^videosearch.html index.php?page=Search&exec=Search&t=video [L,NS]
    RewriteRule ^([0-9]*)-([0-9]*)-videonav-(.*).html index.php?page=Video&action=cat&cat_id=$1&nav=$2&orderby=$3 [L,NS]
    
    RewriteRule ^medialist-(.*)-(.*).html index.php?page=Media&action=cat&cat_id=$1&nav=$2 [L,NS]
    RewriteRule ^media-(.*).html index.php?page=Media&action=showfile&id=$1 [L,NS]
    RewriteRule ^media.html index.php?page=Media [L,NS]
    RewriteRule ^mediacat-(.*).html index.php?page=Media&action=cat&cat_id=$1 [L,NS]
    RewriteRule ^([0-9]*)-([0-9]*)-medianav.html index.php?page=Media&action=cat&cat_id=$1&nav=$2 [L,NS]
    RewriteRule ^media.reportcomment.([0-9]*)-([0-9]*).html index.php?page=Media&action=showfile&id=$2&op=reportcomment&commentid=$1 [L,NS]
    RewriteRule ^mediasearch.html index.php?page=Search&exec=Search&t=screenshots [L,NS]
    
    RewriteRule ^gamestatadd-(.*)-(.*).html index.php?page=Games&action=showgame&id=$1&add=$2 [L,NS]
    RewriteRule ^gamestatrem-(.*)-(.*).html index.php?page=Games&action=showgame&id=$1&remove=$2 [L,NS]
    RewriteRule ^gamemedia-(.*)-(.*).html index.php?page=Games&action=showgame&id=$1&show=Media&nav=$2 [L,NS]
    RewriteRule ^gamelist-([^/]*)-([^/]*)-([0-9]*)-([^/]*).html index.php?page=Games&start=$1&cat=$2&nav=$3&genre=$4 [L,NS]
    RewriteRule ^games.html index.php?page=Games [L,NS]
    RewriteRule ^game-([0-9]*).html index.php?page=Games&action=showgame&id=$1 [L,NS]
    RewriteRule ^game-([0-9]*)-(.*).html index.php?page=Games&action=showgame&id=$1 [L,NS]
    
    RewriteRule ^game.articles-(.*)-(.*).html index.php?page=Games&action=showgame&id=$1&show=articles [L,NS]
    RewriteRule ^game.faq-(.*)-(.*).html index.php?page=Games&action=showgame&id=$1&show=faq [L,NS]
    RewriteRule ^game.achievements-(.*)-(.*).html index.php?page=Games&action=showgame&id=$1&show=achievements [L,NS]
    RewriteRule ^game.files-(.*)-(.*).html index.php?page=Games&action=showgame&id=$1&show=files [L,NS]
    RewriteRule ^game.media-(.*)-(.*).html index.php?page=Games&action=showgame&id=$1&show=media [L,NS]
    RewriteRule ^game.video-(.*)-(.*).html index.php?page=Games&action=showgame&id=$1&show=video [L,NS]
    RewriteRule ^game.cheats-(.*)-(.*).html index.php?page=Games&action=showgame&id=$1&show=cheats [L,NS]
    
    RewriteRule ^topgames.html index.php?page=Top+Games [L,NS]
    RewriteRule ^topgames-(.*).html index.php?page=Top+Games&cat=$1 [L,NS]
    
    RewriteRule ^upcoming-(.*).html index.php?page=Upcoming+Games&cat=$1 [L,NS]
    RewriteRule ^upcoming.html index.php?page=Upcoming+Games [L,NS]
    
    RewriteRule ^members.html index.php?page=Members [L,NS]
    RewriteRule ^memberlist-(.*)-([0-9]*)-(.*).html index.php?page=Members&start=$1&nav=$2&country=$3 [L,NS]
    RewriteRule ^system-(.*) index.php?page=Console&p=$1 [L,NS]
    RewriteRule ^online.html index.php?page=Online [L,NS]
    RewriteRule ^usercp.html index.php?page=User+CP [L,NS]
    RewriteRule ^editprofile-do.html index.php?page=Edit+Profile&edit=do [L,NS]
    RewriteRule ^editprofile.html index.php?page=Edit+Profile [L,NS]
    RewriteRule ^inbox.html index.php?page=User+CP&action=messages [L,NS]
    RewriteRule ^myblog.html index.php?page=User+CP&action=blog [L,NS]
    RewriteRule ^myblog-edit-([0-9]*).html index.php?page=User+CP&action=blog&op=edit&id=$1 [L,NS]
    RewriteRule ^myblog-remove-([0-9]*).html index.php?page=User+CP&action=blog&op=remove&id=$1 [L,NS]
    RewriteRule ^myblog-removeyes-([0-9]*).html index.php?page=User+CP&action=blog&op=remove&id=$1&exec=remove [L,NS]
    RewriteRule ^myblog-add.html index.php?page=User+CP&action=blog&op=add [L,NS]
    
    RewriteRule ^search.html index.php?page=Search&exec=Search [L,NS]
    RewriteRule ^gamesearch.html index.php?page=Search&exec=Search&t=games [L,NS]
    RewriteRule ^cheatsearch.html index.php?page=Search&exec=Search&t=cheats [L,NS]
    RewriteRule ^filesearch.html index.php?page=Search&exec=Search&t=file [L,NS]
    RewriteRule ^forumsearch.html index.php?page=Search&exec=Search&t=forums [L,NS]
    
    RewriteRule ^contact.html index.php?page=Contact [L,NS]
    RewriteRule ^contact-thanks.html index.php?page=Contact&action=thanks [L,NS]
    RewriteRule ^logout.html index.php?page=Logout [L,NS]
    RewriteRule ^logout-yes.html index.php?page=Logout&logmeout=1 [L,NS]
    RewriteRule ^profile-(.*).html index.php?page=User+Profile&u=$1 [L,NS]
    RewriteRule ^allshouts.html shoutbox_all.php [L,NS]
    RewriteRule ^company-(.*).html index.php?page=Company&action=show&t=$1 [L,NS]
    RewriteRule ^register.html index.php?page=Register [L,NS]
    
    RewriteRule ^pages.html index.php?page=Page [L,NS]
    RewriteRule ^page-(.*).html index.php?page=Page&action=showpage&id=$1 [L,NS]
    RewriteRule ^page-(.*)-(.*).html index.php?page=Page&action=showpage&id=$1 [L,NS]
    RewriteRule ^pagenav-(.*).html index.php?page=Page&orderby=$1 [L,NS]
    
    RewriteRule ^blognav-([0-9]*).html index.php?page=Blogs&nav=$1 [L,NS]
    RewriteRule ^blogs.html index.php?page=Blogs [L,NS]
    RewriteRule ^blog-([0-9]*).html index.php?page=Blogs&action=show&id=$1 [L,NS]
    RewriteRule ^blog-([0-9]*)-(.*).html index.php?page=Blogs&action=show&id=$1 [L,NS]
    
    RewriteRule ^forums.html forums.php?page=Forums [L,NS]
    RewriteRule ^forums-allread.html forums.php?page=Forums&op=allread [L,NS]
    RewriteRule ^forum-(.*).html forums.php?page=Forums&show=forum&id=$1 [L,NS]
    RewriteRule ^thread-(.*).html forums.php?page=Forums&show=thread&id=$1 [L,NS]
    RewriteRule ^newthread-(.*).html forums.php?page=Forums&show=newthread&fid=$1 [L,NS]
    RewriteRule ^reply-(.*)-(.*).html forums.php?page=Forums&show=reply&id=$1&fid=$2 [L,NS]
    RewriteRule ^threadnav-(.*)-(.*).html forums.php?page=Forums&show=forum&id=$1&nav=$2 [L,NS]
    RewriteRule ^postnav-(.*)-(.*).html forums.php?page=Forums&show=thread&id=$1&nav=$2 [L,NS]
    RewriteRule ^reply.quote-([0-9]*)-([0-9]*)-([0-9]*).html forums.php?page=Forums&show=reply&id=$2&fid=$3&quote=$1 [L,NS]
    RewriteRule ^post.report-([0-9]*)-([0-9]*).html forums.php?page=Forums&show=report&id=$1&return_thread=$2 [L,NS]
    
    RewriteRule ^video-([0-9]*).html video.php?id=$1 [L,NS]
    
    RewriteRule ^files.html index.php?page=Files [L,NS]
    RewriteRule ^filecat-([0-9]*).html index.php?page=Files&action=cat&cat_id=$1 [L,NS]
    RewriteRule ^file-([0-9]*).html index.php?page=Files&action=showfile&id=$1 [L,NS]
    RewriteRule ^file-([0-9]*)-(.*).html index.php?page=Files&action=showfile&id=$1 [L,NS]
    RewriteRule ^([0-9]*)-([0-9]*)-filenav.html index.php?page=Files&action=cat&cat_id=$1&nav=$2 [L,NS]
    RewriteRule ^([0-9]*)-([0-9]*)-filenav-(.*).html index.php?page=Files&action=cat&cat_id=$1&nav=$2&orderby=$3 [L,NS]
    RewriteRule ^file.reportcomment.([0-9]*)-([0-9]*)-(.*).html index.php?page=Files&action=showfile&id=$2&op=reportcomment&commentid=$1 [L,NS]
    
    RewriteRule ^submitreview-(.*).html index.php?page=Submit&type=Article&ratingid=$1 [L,NS]
    RewriteRule ^submit-news.html index.php?page=Submit+News [L,NS]
    RewriteRule ^submit-file.html index.php?page=Submit&type=File [L,NS]
    RewriteRule ^submit-article.html index.php?page=Submit&type=Article [L,NS]
    RewriteRule ^submitcheat-(.*)-(.*).html index.php?page=Submit&type=Cheats&game=$1&platform=$2 [L,NS]
    RewriteRule ^submit-media.html index.php?page=Submit&type=Media [L,NS]
    RewriteRule ^submit-link.html index.php?page=Submit&type=Links [L,NS]
    
    RewriteRule ^game.cheats-([0-9]*)-(.*).html index.php?page=Games&action=showgame&id=$1&show=Cheats [L,NS]
    RewriteRule ^game.media-([0-9]*)-([0-9*]*).html index.php?page=Games&action=showgame&id=$1&show=Media&nav=$3 [L,NS]
    RewriteRule ^game.articles-([0-9]*)-(.*).html index.php?page=Games&action=showgame&id=$1&show=Articles [L,NS]
    RewriteRule ^game.faq-([0-9]*)-(.*).html index.php?page=Games&action=showgame&id=$1&show=FAQ [L,NS]
    RewriteRule ^game.achievements-([0-9]*)-(.*).html index.php?page=Games&action=showgame&id=$1&show=Achievements [L,NS]
    RewriteRule ^game.files-([0-9]*)-(.*).html index.php?page=Games&action=showgame&id=$1&show=Files [L,NS]
    RewriteRule ^game.video-([0-9]*)-(.*).html index.php?page=Games&action=showgame&id=$1&show=Video [L,NS]
    
    RewriteRule ^story-([0-9]*).html index.php?page=Story&id=$1 [L,NS]
    RewriteRule ^story-([0-9]*)-(.*).html index.php?page=Story&id=$1 [L,NS]
    RewriteRule ^story.reportcomment.([0-9]*)-([0-9]*)-(.*).html index.php?page=Story&id=$2&op=reportcomment&commentid=$1 [L,NS]
    
    RewriteRule ^notepad.html index.php?page=User+CP&action=notepad [L,NS]
    RewriteRule ^sig.jpg sig.php [L,NS]
    RewriteRule ^rss.xml rss.php [L,NS]
    RewriteRule ^rss-articles.xml rss-articles.php [L,NS]
    
    RewriteRule ^forumz?(/.*)?$ http://www.gamerzneeds.net/forums/? [L,R=301]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)$ forums/vbseo.php?vbseourl=$1 [L,QSA]
    
    RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ forums/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
    RewriteCond %{HTTP_HOST} !^www\.gamerzneeds\.net
    RewriteRule (.*) http://www.gamerzneeds.net/$1 [L,R=301]
    
    <Files 403.shtml>
    order allow,deny
    allow from all
    </Files>
    
    deny from ******
    
    AuthUserFile "/home/****/.htpasswds/public_html/passwd"

  8. #8
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,741
    Liked
    168 times
    What exactly is the issue you have now?

  9. #9
    Senior Member
    Real Name
    Matt
    Join Date
    May 2006
    Posts
    973
    Liked
    4 times
    Same as before. I want to have it so when I go to mysite.com/wrongurlhere that it will redirect to mysite.com

    and when I go to mysite.com/forums/wrongurlhere that it will redirect to mysite.com/forums/

  10. #10
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,741
    Liked
    168 times
    Do you have "File not found" handling option in vBSEO CP set to "Redirect to homepage"?

    Edit: that is for the forums/ folder, the code for domain root was posted above: htaccess problem

  11. #11
    Senior Member
    Real Name
    Matt
    Join Date
    May 2006
    Posts
    973
    Liked
    4 times
    Thanks.

    Question: What is your preferred option? Having it redirect or having a custom php page?

  12. #12
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,741
    Liked
    168 times
    I prefer "send 404 code" option to clearly mark incorrect URLs as "not found". You can use it in combination with "Custom page" option to show content to your visitor, while providing 404 http header.

Similar Threads

  1. htaccess problem with vBSEO install
    By Sonnie in forum Troubleshooting
    Replies: 15
    Last Post: 09-05-2006, 01:07 AM
  2. Problem mit dem LogIn
    By smartie in forum Deutsch
    Replies: 5
    Last Post: 05-04-2006, 09:40 PM
  3. htaccess file problem / vbseo problem
    By Bestgfe in forum Troubleshooting
    Replies: 6
    Last Post: 04-05-2006, 09:21 AM
  4. Problem with Colors Forum Tiles
    By rayzor in forum Pre-Sales Questions
    Replies: 2
    Last Post: 04-03-2006, 03:20 AM
  5. several domain name - how to get 301 code in htaccess?
    By Oneclic in forum Custom Rewrite Rules
    Replies: 3
    Last Post: 01-26-2006, 05:11 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
  •