Page 1 of 2 1 2 LastLast
Results 1 to 15 of 16

.htaccess help

This is a discussion on .htaccess help within the Troubleshooting forums, part of the vBSEO SEO Plugin category; Correct me if i am wrong but i am under the allusion that using the .htaccess file it would be ...

  1. #1
    Senior Member Michael's Avatar
    Real Name
    Michael Benson
    Join Date
    Sep 2005
    Location
    United Kingdom
    Posts
    776
    Liked
    0 times

    .htaccess help

    Correct me if i am wrong but i am under the allusion that using the .htaccess file it would be possible for me to redirect all my previous thread URLs to a new setup which i have recently implemented?

    Basically my old URL format was like so:
    http://www.myforums.com/forum-name/t...itle-4541.html

    But i have decided to make them a little more content friendly, like so:
    http://www.myforums.com/forum-name/v...tle-t4541.html

    Now could anyone provide me with an appropriate .htaccess redirect rule which would ensure that anyone visiting the URL in the format as described above, would be 301 redirected to the threads new location? Since currently only "Page Not Found" errors are being displayed when users try and access indexed pages from search engines and threads posted from forums alike.

    :(

  2. #2
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    Michael,

    do you mean that "vbulletin" word is added before the thread title and "t" character before thread id?

    If so, try the following rewrite rules:

    RewriteRule ^([^/]+)/([^/]+)-(\d+)\.html$ $1/vbulletin-$2-t$3.html

  3. #3
    Senior Member Michael's Avatar
    Real Name
    Michael Benson
    Join Date
    Sep 2005
    Location
    United Kingdom
    Posts
    776
    Liked
    0 times
    Yes, the following have been added.
    I'll give this is a try now.

  4. #4
    Senior Member Michael's Avatar
    Real Name
    Michael Benson
    Join Date
    Sep 2005
    Location
    United Kingdom
    Posts
    776
    Liked
    0 times
    This doesnt appear to have made any difference. From viewing what Google has indexed of my site here, and trying out some of the thread URLs it has stored i am still receiving the same error, "Page Not Found".

    Example:
    http://www.staff-lounge.com/entertai.../trapt-40.html

    And yet the below URL which adds "vbulletin-" and "t" works still:
    http://www.staff-lounge.com/entertai...trapt-t40.html

  5. #5
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    Did you added new RewriteRule at the top of others, right after "RewriteEngine on" line? (it is required)

  6. #6
    Senior Member Michael's Avatar
    Real Name
    Michael Benson
    Join Date
    Sep 2005
    Location
    United Kingdom
    Posts
    776
    Liked
    0 times
    Here is my current .htaccess file:

    ... nothing to see ...
    Last edited by Michael; 12-16-2005 at 01:40 PM.

  7. #7
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    Please add [L,R=301] to the new rewriterule line.

  8. #8
    Senior Member Michael's Avatar
    Real Name
    Michael Benson
    Join Date
    Sep 2005
    Location
    United Kingdom
    Posts
    776
    Liked
    0 times
    Do you mean like so;
    RewriteRule ^([^/]+)/([^/]+)-(\d+)\.html$ $1/vbulletin-$2-t$3.html [L,R=301]
    I have tried implementing the following suggestion but just receive "Page Not Found" message error once again.

  9. #9
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    Hm.. it works for me.

    Try to replace
    [^/] with . (dot)
    and
    \d with [0-9]

  10. #10
    Senior Member Michael's Avatar
    Real Name
    Michael Benson
    Join Date
    Sep 2005
    Location
    United Kingdom
    Posts
    776
    Liked
    0 times
    Thank you the last change made all the difference and now works appropriately. What exactly did this last change do?

  11. #11
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    It changes the "character class" in regular expression, because more advanced regexp modifiers are not supported by some mod_rewrite versions.

    You can try to revert one of the replacements mentioned to find out exactly which one of them is not supported.

  12. #12
    Senior Member Michael's Avatar
    Real Name
    Michael Benson
    Join Date
    Sep 2005
    Location
    United Kingdom
    Posts
    776
    Liked
    0 times
    Quote Originally Posted by Oleg Ignatiuk
    It changes the "character class" in regular expression, because more advanced regexp modifiers are not supported by some mod_rewrite versions.

    You can try to revert one of the replacements mentioned to find out exactly which one of them is not supported.
    How can you find out which mod_rewrite version a server is running?
    How can you upgrade to a later version which could support these more "advanced regexp modifiers"?

  13. #13
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    It depends on the Apache version you are running.
    I can't say exactly now which versions support different character classes in regexps, but this is something I noticed.

  14. #14
    Senior Member Michael's Avatar
    Real Name
    Michael Benson
    Join Date
    Sep 2005
    Location
    United Kingdom
    Posts
    776
    Liked
    0 times
    Quote Originally Posted by Oleg Ignatiuk
    It depends on the Apache version you are running.
    I can't say exactly now which versions support different character classes in regexps, but this is something I noticed.
    I am currently running Apache 1.3.34, and PHP 4.4.0

  15. #15
    Senior Member Michael's Avatar
    Real Name
    Michael Benson
    Join Date
    Sep 2005
    Location
    United Kingdom
    Posts
    776
    Liked
    0 times
    It currently appears as though there is a conflict with the .htaccess code added. Firstly, in my site Archive, and in my vB Easy Archive their URLs are as followed:

    vBulletin Archive: /sitemap/f-3.html
    And is being rewritten to: http://www.staff-lounge.com/feedback...policy-t3.html

    vB Easy Archive: /vbulletin/forum/3-1.html
    And is being rewritten to: http://www.staff-lounge.com/site-ann...-rules-t1.html

    Now then could it be possible for in the .htaccess file to specify for this rule added from this thread not to apply for the /vbulletin/ and /sitemap/ folders. Or is there any other way to fix this issue?

Page 1 of 2 1 2 LastLast

Similar Threads

  1. .htaccess for hotlink protection
    By Mert Gökçeimam in forum General Discussion
    Replies: 7
    Last Post: 03-06-2007, 09:28 PM
  2. Moving info from .htaccess to httpd.conf
    By Tigermoth in forum Troubleshooting
    Replies: 11
    Last Post: 01-01-2007, 07:24 AM
  3. Add "www." in .htaccess
    By Jason|Xoxide in forum Custom Rewrite Rules
    Replies: 8
    Last Post: 03-31-2006, 11:54 AM
  4. "Test Site" appears when I make .htaccess active
    By gabeanderson in forum Troubleshooting
    Replies: 1
    Last Post: 03-22-2006, 05:50 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
  •