Need biz directory mod_rewrite code!

Discussion in 'Apache' started by Tuning, May 1, 2005.

  1. #1
    Hello All,
    Need help on HTMLizing biz_directory script.

    Can anyone point where can I get the code and htaccess ?

    Thanks in advance. :)
     
    Tuning, May 1, 2005 IP
  2. WhatiFind

    WhatiFind offline

    Messages:
    1,789
    Likes Received:
    257
    Best Answers:
    0
    Trophy Points:
    180
    #2
    try something like this
    RewriteEngine on
    RewriteRule ^([0-9]+).php$ index.php?c=$1& [L]
    RewriteRule ^([0-9]+)add.php$ add_url.php?c=$1& [L]  
    Code (markup):
    or check this forum and search for biz-directory http://www.mod-rewrite.com/forum/
    And check if your server supports mod-rewrite.
     
    WhatiFind, May 1, 2005 IP
    seo-mumbai likes this.
  3. Tuning

    Tuning Well-Known Member

    Messages:
    1,005
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    138
    #3
    Thanks WhatFind.

    Best Regards,
    Tuning
     
    Tuning, May 1, 2005 IP
  4. larysmith711

    larysmith711 Notable Member

    Messages:
    3,374
    Likes Received:
    341
    Best Answers:
    0
    Trophy Points:
    215
    #4
    That mod_rewrite forum is a great place to go. Isn't that SEO Guy's?
     
    larysmith711, May 2, 2005 IP
  5. WhatiFind

    WhatiFind offline

    Messages:
    1,789
    Likes Received:
    257
    Best Answers:
    0
    Trophy Points:
    180
    #5
    I think it is.. On the server that runs that mod_rewrite forum are sites running like acme-tools.com , at that site are many links to seo-guy. (reverse ip) Also the ip adress is 3 numbers from seo-guy server.. .. .. 71.68 / .. .. 71.71
     
    WhatiFind, May 2, 2005 IP
  6. samsam

    samsam Peon

    Messages:
    647
    Likes Received:
    53
    Best Answers:
    0
    Trophy Points:
    0
    #6
    samsam, Jul 21, 2005 IP
  7. Swordfish

    Swordfish Active Member

    Messages:
    988
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #7
    I could'nt find what I was looking for.. were you able to get the rewrite working?
     
    Swordfish, Jul 22, 2005 IP
  8. Tuning

    Tuning Well-Known Member

    Messages:
    1,005
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    138
    #8
    Yes, but only recently. [ Never had time to research on it ;)]

    Here is what you have to do. This document is traslated ( and also altered according to my needs ) from german.:)
    http://www.modrewrite.de/foren/ftopic564.html
    
    Index.php Page Modification:
    =================
    
    Line 41
    
    $category_url = $dir.'index.php?c='.$parent_categories[$x]["id"];
    
    Replace with:
    
    $category_url = $dir.$parent_categories[$x]["id"].'-directory.html';
    
    --------------------------------
    
    Line 60
    
    $replace = array("[CATEGORY_NAME]" => $subcategories[$x]["name"], "[CATEGORY_URL]" => $dir.'index.php?c='.$subcategories[$x]["id"]);
    
    Replace with:
    
    $replace = array("[CATEGORY_NAME]" => $subcategories[$x]["name"], "[CATEGORY_URL]" => $dir.$subcategories[$x]["id"].'-directory.html');
    
    --------------------------------
    
    Line 66
    
    $replace = array("[CATEGORY_NAME]" => $subcategories[$x]["name"], "[CATEGORY_URL]" => $dir.'index.php?c='.$subcategories[$x]["id"]);
    
    Replace with:
    
    $replace = array("[CATEGORY_NAME]" => $subcategories[$x]["name"], "[CATEGORY_URL]" => $dir.$subcategories[$x]["id"].'-directory.html');
    
    --------------------------------
    
    Line 76
    
    $replace = array("[CATEGORY_NAME]" => $current_category["name"], "[SUBMISSION_URL]" => $dir.'add_url.php?c='.$c);
    
    Replace with:
    
    $replace = array("[CATEGORY_NAME]" => $current_category["name"], "[SUBMISSION_URL]" => $dir.$c.'-add-url.html');
    
    --------------------------------
    
    Line 110
    
    if ($c != 1) { $query = "index.php?c=$c"; };
      if (($c != 1) & $s != 1){
        $query .= "&s=$s";
      }elseif ($s != 1){
        $query = "index.php?s=$s";
    };
    
    Replace with:
    
    if ($c != 1) { $query = "$c-directory.html"; };
      if (($c != 1) & $s != 1){
        $query = "$c-$s-directory.html";
      }elseif ($s != 1){
        $query = "$c-$s-directory.html";
    };
    
    Modification of add_url.php Page.
    ========================
    Line 41:
    
    $category_url = $dir.'index.php?c='.$parent_categories[$x]["id"];
    
    Replace with:
    
    $category_url = $dir.$parent_categories[$x]["id"].'-directory.html';
    
    Addition to Htaccess
    ======================
    RewriteEngine On
    
    RewriteRule index.html$ /index.php [PT]
    RewriteRule ^([0-9]+)-directory.html$ /index.php?c=$1
    RewriteRule ^([0-9]+)-directory.html$ /index.php?s=$1
    RewriteRule ^([0-9]+)-([0-9]+)-directory.html$ /index.php?c=$1&s=$2
    RewriteRule ^([0-9]+)-add-url.html$ /add_url.php?c=$1
    
    Code (markup):
    See it working here :
    www.directoryone.info

    Regards,
    Tuning
     
    Tuning, Jul 24, 2005 IP
    capebretoner likes this.
  9. NeoGen

    NeoGen Writer

    Messages:
    2,303
    Likes Received:
    301
    Best Answers:
    0
    Trophy Points:
    230
    #9
    Nice job Tuning :D
     
    NeoGen, Jul 24, 2005 IP
  10. Tuning

    Tuning Well-Known Member

    Messages:
    1,005
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    138
    #10
    Hi Webhost,

    How do you changed the template of alldotnet ?

    I tried all 10hrs today to change the template. But failed. :(

    The main thing is that where to put tables ? :confused:

    I tried editing index_template.php but no luck!

    Anyidea ? :rolleyes:

    I just want to make this site similar looking to
    www.directorysubmission.net ;)

    Regards,
    Tuning
     
    Tuning, Jul 24, 2005 IP
  11. NeoGen

    NeoGen Writer

    Messages:
    2,303
    Likes Received:
    301
    Best Answers:
    0
    Trophy Points:
    230
    #11
    Have you looked at each template block that is saved in a PHP variable, for instance:

    $TEMPLATE["HEADING"] = <<<EOF
    Here the editable text!
    EOF;
     
    NeoGen, Jul 24, 2005 IP
  12. honey

    honey Prominent Member

    Messages:
    15,555
    Likes Received:
    712
    Best Answers:
    0
    Trophy Points:
    325
    #12
    Pretty good work Tuning.
     
    honey, Jul 24, 2005 IP
  13. capebretoner

    capebretoner Well-Known Member

    Messages:
    536
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    128
    #13
    That was awesome thanks Tuning :D
     
    capebretoner, Aug 31, 2005 IP
  14. kandeman

    kandeman Peon

    Messages:
    451
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #14


    I really can't get this to work , I changed everything in the files and made a new .htacces (in the subdirectory where the script is installed) but when I click a ategory it just says file not found.

    Did I make the .htacces correcy by just pasting the rewrite rules code into a blank file and saving it as .htacces ?

    Help me please:)
     
    kandeman, Sep 24, 2005 IP
  15. Tuning

    Tuning Well-Known Member

    Messages:
    1,005
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    138
    #15
    Could you give me the URL ?

    Regards,
    Tuning
     
    Tuning, Sep 24, 2005 IP
  16. kandeman

    kandeman Peon

    Messages:
    451
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
  17. Tuning

    Tuning Well-Known Member

    Messages:
    1,005
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    138
    #17
    I think you are using Apache 2. I have no idea about mod_rewrite and Apache 2.
    Perhaps that can be the problem.

    Have to ask Nintendo. You can also PM him more about this.

    Sorry. :eek:
     
    Tuning, Sep 24, 2005 IP
  18. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #18
    I'm on 2.0.46. I don't know anything about that script, just at changing URLs....

    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule index.html$ index.php [PT]
    RewriteRule ^([^.]+)-([^.]+)-directory.html$ index.php?c=$1&s=$2
    RewriteRule ^([^.]+)-directory.html$ index.php?c=$1
    RewriteRule ^([^.]+)-directory.html$ index.php?s=$1
    RewriteRule ^([^.]+)-add-url.html$ add_url.php?c=$1

    If for example changing

    index.php?s=WHATEVER
    to
    WHATEVER-directory.html
     
    Nintendo, Sep 24, 2005 IP
  19. Tuning

    Tuning Well-Known Member

    Messages:
    1,005
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    138
    #19
    Thanks Nintendo. :)
     
    Tuning, Sep 24, 2005 IP
  20. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #20
    If that doesn't do it, try using

    (.*)

    That covers every character.
     
    Nintendo, Sep 24, 2005 IP