mod_rewrite? or alternative

Discussion in 'Apache' started by Hades, Apr 28, 2007.

  1. #1
    Hi. I own a blog, www.search4anime.com and currently, to browse it for downloads, you have to go through a number of pages. So if you were to go to Anime Downloads, Completed Anime Downloads, Choose a Letter, and then go to the anime you want, you would end up at something like this

    http://www.search4anime.com//?page_id=17

    I have tried using the custom feature in the options for the permalinks, setting it to /%pagename%/%pagename%/%pagename%/%pagename%/%pagename%/
    Which made it work, but then the posts, if you click on them don't work. I want it to allow me to have the anime stuff down right, but also the posts to work properly. can anyone help me do this, or would i have to use an .htaccess file for this? and How would I do that?
     
    Hades, Apr 28, 2007 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #2
    Post a static version of the URL you want search4anime.com/index.php?page_id=17 to become.
     
    Nintendo, Apr 28, 2007 IP
  3. Hades

    Hades Well-Known Member

    Messages:
    1,873
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    150
    #3
    Not sure what you mean, but i think it woudl be like this

    www.search4anime.com/animedownloads/completedanime

    would the only way to do this be with .htaccess , and i'd have to do it for every url? That would be very bad and inefficient. Is there a better way? Cause I would be adding about 10 or so links every day, constantly.
     
    Hades, Apr 28, 2007 IP
  4. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #4
    You would have to have the number be in the URL then you could do it with one line. You would have to know how to edit the script to link that way.

    Options +FollowSymLinks +Indexes
    RewriteEngine on
    RewriteBase /
    RewriteRule ^([^.]+)/([^.]+)/([^.]+)\.html$ showproducts.php?cat=$1 [L]

    domain.com/17/animedownloads/completedanime
     
    Nintendo, Apr 28, 2007 IP
  5. Hades

    Hades Well-Known Member

    Messages:
    1,873
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    150
    #5
    Hmm. But they are all different numbers though. Like for each anime title, there is a different number. I think i have around 200 so far, and i've only got up to F done for completed anime. I was hoping there was a way to do it with the wordpress permalinks thing.
     
    Hades, Apr 28, 2007 IP
  6. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #6
    ([^.]+) and $1 makes it so it can be anything.
     
    Nintendo, Apr 28, 2007 IP
  7. Hades

    Hades Well-Known Member

    Messages:
    1,873
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    150
    #7
    so doesn't it mean that it will change everything into the url

    domain.com/17/animedownloads/completedanime

    ?
     
    Hades, Apr 28, 2007 IP
  8. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #8
    domain.com/17/animedownloads/completedanime
    domain.com/16/toydownloads/moreanime
    domain.com/15/morestuff/evenmorestuff

    would just need one line. The script has to be edited to make the URLs link correctly.
     
    Nintendo, Apr 28, 2007 IP