rewrite help

Discussion in 'Apache' started by choice, Apr 8, 2007.

  1. #1
    i need to know what to put in htaccess fiile that will make my urls

    on www.bidsdirectory.com show as

    example
    goto directories category it shows as d.html i want it to be directories.html

    any ideas

    this is what is currenty in htaccess
    # Enable mod_rewrite engine
    RewriteEngine On
    
    # Translate content requests
    RewriteRule ^link/([0-9].*).html(.*)$ /index.php?link=$1$2
    RewriteRule ^([A-Za-z0-9_].*).html/([0-9].*)$ index.php?id=$1&page=$2
    RewriteRule ^([A-Za-z0-9_].*).html$ index.php?id=$1
    Code (markup):
     
    choice, Apr 8, 2007 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #2
    You have to know php and know how to edit the script so they link there, and also know how to get rid of special characters and spaces.

    What you got right is messed up. Entertainment --> http://www.bidsdirectory.com/e.html

    is just a page for 'e'!
     
    Nintendo, Apr 9, 2007 IP
  3. choice

    choice Prominent Member

    Messages:
    5,444
    Likes Received:
    490
    Best Answers:
    0
    Trophy Points:
    350
    Digital Goods:
    2
    #3
    i know but if i change e.html to entertainment.html i get page cannot be found
     
    choice, Apr 9, 2007 IP
  4. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #4
    Is 'e' in the original URL?

    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^([^.]+)/([^.]+)\.html$ index.php?id=$1 [L]

    http://www.bidsdirectory.com/e/Entertainment.html

    But you would have to know how to edit the script to make it link like that.
     
    Nintendo, Apr 9, 2007 IP
  5. choice

    choice Prominent Member

    Messages:
    5,444
    Likes Received:
    490
    Best Answers:
    0
    Trophy Points:
    350
    Digital Goods:
    2
    #5
    here is the part of the code that has the urls in

    <div class="tmenu" id="tmenu">
    <a href="{dir_base}a.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Arts</div></a>
    <a href="{dir_base}b.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Business</div></a>
    <a href="{dir_base}c.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Computers</div></a>
    <a href="{dir_base}d.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Directories</div></a>
    <a href="{dir_base}e.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Entertainment</div></a>
    <a href="{dir_base}f.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Education</div></a>
    <a href="{dir_base}g.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Goverment</div></a>
    <a href="{dir_base}h.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Health</div></a>
    <a href="{dir_base}i.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Internet</div></a>
    <a href="{dir_base}k.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Kids & Teens</div></a>
    <a href="{dir_base}l.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Lifestyle</div></a>
    <a href="{dir_base}m.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Myspace</div></a>
    <a href="{dir_base}n.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">News</div></a>
    <a href="{dir_base}p.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">People</div></a>
    <a href="{dir_base}r.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Recreation</div></a>
    <a href="{dir_base}u.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Shopping</div></a>
    <a href="{dir_base}s.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Sport</div></a>
    <a href="{dir_base}t.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Technology</div></a>
    <a href="{dir_base}v.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Real Estate</div></a>
    <a href="{dir_base}w.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Science</div></a>
    <a href="{dir_base}x.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Webmaster</div></a>
    <a href="{dir_base}reference.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Reference</div></a>
    <a href="{dir_base}y.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Forums</div></a>
    <a href="{dir_base}z.html"><div class="{linkstyle}" onMouseOver="this.className='{linkstyle}h'" onMouseOut="this.className='{linkstyle}'">Hosting</div></a>
    <br clear="all" />
    </div>
    Code (markup):
     
    choice, Apr 9, 2007 IP
  6. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #6
    What were the original URLs like, the non-mod_rewrite ones? It wasn't a.html cause they don't work.
     
    Nintendo, Apr 9, 2007 IP
  7. choice

    choice Prominent Member

    Messages:
    5,444
    Likes Received:
    490
    Best Answers:
    0
    Trophy Points:
    350
    Digital Goods:
    2
    #7
    thats what they where originally look at this site www.biduplinks.com

    running same script as www.bidsdirectory.com i just changed from alphabet to category
     
    choice, Apr 9, 2007 IP
  8. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #8
    Nintendo, Apr 9, 2007 IP