Results 1 to 7 of 7

How to rewrite /news.html to the / ?

This is a discussion on How to rewrite /news.html to the / ? within the General Discussion forums, part of the vBulletin SEO Discussion category; Hi! We have a small problem. Previously we had a main homepage as /news.html but now /index.html (the same as ...

  1. #1
    Junior Member
    Real Name
    Fenriz
    Join Date
    Oct 2006
    Location
    Norway
    Posts
    24
    Liked
    3 times

    How to rewrite /news.html to the / ?

    Hi! We have a small problem. Previously we had a main homepage as /news.html but now /index.html (the same as just root "/"). How can we make a 301-redirection from "/news.html" to the "/"?
    Last edited by Fenriz; 09-22-2007 at 06:50 PM.

  2. #2

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

    you can redirect it with:

    Code:
    RewriteEngine on 
    RewriteRule ^news\.html$ http://www.yourdomain.com/ [L,R=301]
    RewriteRule ^(.*/)?(?:index\.(?:html?|php))$ http://www.yourdomain.com/$1 [L,R=301]
    Last edited by Oleg Ignatiuk; 09-25-2007 at 01:17 PM.

  4. #4
    Junior Member
    Real Name
    Fenriz
    Join Date
    Oct 2006
    Location
    Norway
    Posts
    24
    Liked
    3 times
    Code:
     
    RewriteRule ^news\.html$ http://ulfdalir.ulver.com/ [L,R=301]
    RewriteRule ^(.*/)?(?:index\.(?:html?|php))$ http://ulfdalir.ulver.com/$1 [L,R=301]
    - get 500 Internal Server Error

  5. #5
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    168 times
    Do you get it for any URL or for specific link only?

  6. #6
    Junior Member
    Real Name
    Fenriz
    Join Date
    Oct 2006
    Location
    Norway
    Posts
    24
    Liked
    3 times
    .htaccess include the next code:
    Code:
     
    Options -Indexes
    DirectoryIndex index.html
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^www\.ulfdalir\.ulver\.com$ [NC]
    RewriteRule ^(.*)$ http://ulfdalir.ulver.com/$1 [L,R=301]
    rewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/ 
    rewriteRule ^index\.html$ http://ulfdalir.ulver.com/ [R=301,L]
    rewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /news\.html\ HTTP/ 
    rewriteRule ^news\.html$ http://ulfdalir.ulver.com/ [R=301,L]
    If I change the last 4 strings to the code you provided:
    Code:
    RewriteRule ^news\.html$ http://ulfdalir.ulver.com/ [L,R=301]
    RewriteRule ^(.*/)?(?:index\.(?:html?|php))$ http://ulfdalir.ulver.com/$1 [L,R=301]
    , get just "500 Error" on the root http://ulfdalir.ulver.com/

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

    replied to your support ticket.

Similar Threads

  1. Syntax for Custom Rewrite Rules
    By Joe Ward in forum Custom Rewrite Rules
    Replies: 33
    Last Post: 02-10-2011, 08:49 PM
  2. Full vBulletin Rewrite System
    By Snake in forum Custom Rewrite Rules
    Replies: 13
    Last Post: 06-05-2007, 10:42 PM
  3. Rewrite vBa static folders and pages
    By eJM in forum Custom Rewrite Rules
    Replies: 3
    Last Post: 11-17-2006, 06:47 PM
  4. vBSEO 2.0 RC7 Released
    By Juan Muriente in forum vBSEO Announcements
    Replies: 17
    Last Post: 09-08-2005, 11:00 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
  •