Results 1 to 13 of 13

Redirect the site not found links?

This is a discussion on Redirect the site not found links? within the General Discussion forums, part of the vBulletin SEO Discussion category; Hi, The links which are in forum like domain.com/forum/***.html, redirect to main folder becz this is an option in vbseo ...

  1. #1
    Senior Member
    Real Name
    Mohamed
    Join Date
    Dec 2006
    Posts
    3,891
    Liked
    1 times

    Redirect the site not found links?

    Hi,

    The links which are in forum like domain.com/forum/***.html, redirect to main folder becz this is an option in vbseo.

    But what about the domain.com/***.html links?
    I have alot of not found links like this and the 404 error page doesn`t work, so is there any .htaccess code can do this job like vbseo?

    Thanks.

  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,

    you can create .htaccess in domain root to redirect all not found pages to the homepage:
    Code:
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .+ http://www.domain.com/? [L,R=301]
    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
    Senior Member
    Real Name
    Mohamed
    Join Date
    Dec 2006
    Posts
    3,891
    Liked
    1 times
    It works, thanks alot

  4. #4
    Member
    Real Name
    attiah aly
    Join Date
    Mar 2009
    Location
    Egypt
    Posts
    69
    Liked
    0 times
    hello Oleg

    how can i

    just if any body request any php file like search.php or showthread.php , ... and not found it in http://www.cgway.net it's redirect to the same file in http://forums.cgway.net/

    i don't need to redirect all php files or use

    Quote:
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://www.site.com/$1 [L,R=301]
    because i have already different php files work in http://www.cgway.net

    and the same idea for folders that's all

  5. #5
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    You can use this:
    Code:
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule (.*\.php) http://forums.cgway.net/$1 [L,R=301]
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  6. #6
    Member
    Real Name
    attiah aly
    Join Date
    Mar 2009
    Location
    Egypt
    Posts
    69
    Liked
    0 times
    Oleg Your code work perfectly in php files but not work in not found folders


    i need when request as example http://www.cgway.net/award and this folder not found it's redirect to http://forums.cgway.net/award


    really thanks to you

  7. #7
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    Then you should change last line to:
    Code:
    RewriteRule (.+) http://forums.cgway.net/$1 [L,R=301]
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  8. #8
    Member
    Real Name
    attiah aly
    Join Date
    Mar 2009
    Location
    Egypt
    Posts
    69
    Liked
    0 times
    it's work very good but this is the final request

    when any body request any folder or files from http://www.cgway.net or http://forums.cgway.net/ and this folders or files already not found in my server
    it's give me an error

    in the Navigation bar http://forums.cgway.net/.php

    and the error message

    The page isn't redirecting properly

    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
    i need when requests any not valid or found folders or files in http://www.cgway.net or http://forums.cgway.net/ will be redirect to my forums homepage http://forums.cgway.net/


    this is my htaccess for my home page and my forums and all in my httpd.conf

    my homepage http://www.cgway.net

    <Directory "/*****/*****/public_html">

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^cgway.net$ [OR]
    RewriteCond %{HTTP_HOST} ^cgway.org$ [OR]
    RewriteCond %{HTTP_HOST} ^www.cgway.org$
    RewriteRule ^(.*)$ http://www.cgway.net/$1 [L,R=301]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule .(gif|GIF|jpg|JPG|png|PNG|BMP|bmp)$ http://www.cgway.net/images/cg-noimg.gif [R,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule (.+) http://forums.cgway.net/$1 [L,R=301]
    #RewriteRule (.*\.php) http://forums.cgway.net/$1 [L,R=301]


    # Turn on Expires and set default to 0
    ExpiresActive On
    ExpiresDefault A0

    # Set up caching on media files for 1 year (forever?)
    <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$" >
    ExpiresDefault A29030400
    </FilesMatch>

    # Set up caching on media files for 1 week
    <FilesMatch "\.(gif|jpg|jpeg|png|swf)$">
    ExpiresDefault A604800
    </FilesMatch>


    # Set up 2 Hour caching on commonly updated files
    <FilesMatch "\.(xml|txt|html|js|css)$">
    ExpiresDefault A7200
    </FilesMatch>

    # Force no caching for dynamic files
    <FilesMatch "\.(php|cgi|pl|htm)$">
    ExpiresActive Off
    </FilesMatch>


    </Directory>
    my forums http://forums.cgway.net/


    <Directory "/*****/****/public_html/forums">
    RewriteEngine On

    RewriteBase /

    #RewriteCond %{HTTP_HOST} !^www\.cgway\.net
    #RewriteRule (.*) http://forums.cgway.net/$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>
    check it maybe have an conflict


    really thanks for you

  9. #9
    Member
    Real Name
    attiah aly
    Join Date
    Mar 2009
    Location
    Egypt
    Posts
    69
    Liked
    0 times
    any other links in my forums like http://forums.cgway.net/cgway84/cg15981/index2.html

    give me the same error

  10. #10
    Member
    Real Name
    attiah aly
    Join Date
    Mar 2009
    Location
    Egypt
    Posts
    69
    Liked
    0 times
    i wait the replay

  11. #11
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    Please try to modify functions_vbseo_url.php file:
    find:
    PHP Code:
    if ($vboptions['forumhome'] != 'index'
    add above:
    PHP Code:
    global $vboptions
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  12. #12
    Member
    Real Name
    attiah aly
    Join Date
    Mar 2009
    Location
    Egypt
    Posts
    69
    Liked
    0 times
    Really i can't find any words to you

    Oleg Really thanks to you

    all now working very good

    you are the best

  13. #13
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    I'm glad we got it working!
    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. 301 fügt ?vbseourl= mit an
    By Junior in forum Deutsch
    Replies: 8
    Last Post: 11-20-2006, 02:07 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
  •