1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Rewrite rule needed for ODP Script

Discussion in 'Apache' started by wolfie, Aug 3, 2005.

  1. #1
    Ok, I was directed to this forum from: http://forums.digitalpoint.com/showthread.php?t=23440
    Looks like a right place now. eh.. :rolleyes:

    I don't/can't post all URLs to here, because script will import them from ODP so there's tons of them and they may change.
    Just a three as an example. Maybe I'll get it myself after a little help with these. But ask if you need more info.

    THESE NEED TO BE CHANGED:
    http://www.domain.com/index.php?c=Games
    http://www.domain.com/index.php?c=Activities_and_Practices/Soccer
    TO:
    http://www.domain.com/Games/
    http://www.domain.com/Activities_and_Practices/Soccer/

    AND THIS: (looks a little more complicated to me)
    http://www.domain.com/index.php?c=Play,_Football,_and_Soccer/How_to/Rules
    TO:
    http://www.domain.com/Play_Football_and_Soccer/How_to/Rules/

    Another question is, will the one mod_rewrite rule actually change whole directory links? If so, its truly a pure voodoo! :eek:

    The script I use - homepage is here: http://www.site-directory.org/odp_script.php

    Guess I need to edit index.php too??
     
    wolfie, Aug 3, 2005 IP
  2. jlawrence

    jlawrence Peon

    Messages:
    1,368
    Likes Received:
    81
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try something like

    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^(.*) index.php?c=$1

    This probably isn't the most secure way of doing it.
    The mod_rewrite will not actually change the links as displayed in the html, you'll have to do that yourself.
     
    jlawrence, Aug 3, 2005 IP
  3. wolfie

    wolfie Member

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    I tried that and other similar ones but it won't do nothing for me.
    When accessing domain.com/Games/ etc. - I get 404 like usual.
     
    wolfie, Aug 3, 2005 IP
  4. wolfie

    wolfie Member

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #4
    Ok, looks like it's working but I need to edit php-files somehow, damit!
    Because script give message: "ODP data temporarily unaccessible" and it's not ODP problem, but script try to look wrong category.

    http://www.domain.com/TMP.html
    ...will look for category "ml" from ODP.
    Page title will be as well, "ml".

    http://www.domain.com/Activities_and_Practices.html
    ..will give page a title
    "ties and Practices.html"

    Hmm.. TMP.html minus index. = ml´
    Ok.. That's it! I'll go to smoke.

    Am I even at right track here, and is this .htaccess lines I use correct at all?

    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^(.*)\.html$ index.php?c=$1 [L]
     
    wolfie, Aug 3, 2005 IP
  5. l234244

    l234244 Peon

    Messages:
    1,225
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If your changing the url to mae them search engine friendly you then you may aswell not bother, Google has kicked hundreds of ODP scraper sites out their index recently
     
    l234244, Aug 3, 2005 IP
  6. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #6
    Make sure sub-sub-sub directories work. When I hade extra /'s in the URL, I had to add extra lines of code. If they give 404 messages...

    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)\.html$ index.php?c=$1 [L]
    RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)\.html$ index.php?c=$1 [L]
    RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.*)\.html$ index.php?c=$1 [L]
    RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)\.html$ index.php?c=$1 [L]
    RewriteRule ^(.*)/(.*)/(.*)/(.*)\.html$ index.php?c=$1 [L]
    RewriteRule ^(.*)/(.*)/(.*)\.html$ index.php?c=$1 [L]
    RewriteRule ^(.*)/(.*)\.html$ index.php?c=$1 [L]
    RewriteRule ^(.*)\.html$ index.php?c=$1 [L]
     
    Nintendo, Aug 3, 2005 IP
  7. wolfie

    wolfie Member

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #7
    Thanks guys for help.
    Htaccess part is done now but I can't modify script because license.
    Well, its free so what you can except.
     
    wolfie, Aug 4, 2005 IP
  8. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #8
    E-Mail the script creator. Maybe they'll give you permission to, since it's only the URLs being changed.
     
    Nintendo, Aug 4, 2005 IP
  9. wolfie

    wolfie Member

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #9
    I did it already but response was pretty strict and clear. No modifications to free scripts.
     
    wolfie, Aug 4, 2005 IP
  10. jlawrence

    jlawrence Peon

    Messages:
    1,368
    Likes Received:
    81
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Then bin it and use another script.
     
    jlawrence, Aug 4, 2005 IP