301 redirect limit or what am I doing wrong?

Discussion in 'Apache' started by Julia-IT-Inventors, May 28, 2006.

  1. #1
    Hi guys, maybe you can help me, it's the third day I am fighting with rewrite and it still wins

    I have a php ld directory and I am trying to make it seo friendly before annoucement.
    Now I am using rewrite by rewriter.php mod that takes pages name form DB and .htaccess looks like this:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^juliawebdirectory\.com
    RewriteRule ^(.*)$ http://www.juliawebdirectory.com/$1 [R=permanent,L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule ^Architecture(.*) index.php [R=301,L]

    it worked fine for several lines but there are 273 lines for categories and subcategories and after ~30th below folling pages start returning 404 error however the previous ones still work.

    If I delete [R=301,L] everything works fine but I would like to have exactly 301 redirect instead of 302 defalt.

    What am I doing wrong, how to fix the problem? And can somebody help me with code for making urls of category and subcategory pages to be like this

    http://www.juliawebdirectory.com/Arts/Architecture.php
    http://www.juliawebdirectory.com/Arts/Architecture2.php

    and so on

    instead of current http://www.juliawebdirectory.com/Arts/Architecture/

    Thank you!
    Julia
     
    Julia-IT-Inventors, May 28, 2006 IP
  2. Julia-IT-Inventors

    Julia-IT-Inventors Active Member

    Messages:
    369
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    58
    #2
    just tried another option - deleted [R=301,L]
    from lines for main categories and it's worked out!!! all sucategories still has [R=301,L] and work OK. I wonder was it something like 'duplicate" redirect aplied to category and then its subcategory and that's why it didn't work?

    I think I will leave it for now but if somebody sees another solution please share it here.

    And how can I make URLs look more natural

    for example http://www.juliawebdirectory.com/Arts/Architecture/ rewritten to http://www.juliawebdirectory.com/Arts/Architecture.php ?

    remembering that the category and subcategory names are taken from the DB.
     
    Julia-IT-Inventors, May 28, 2006 IP
  3. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #3
    er, it's better with out .php. ie, the way it is now.
     
    Nintendo, May 29, 2006 IP
  4. Julia-IT-Inventors

    Julia-IT-Inventors Active Member

    Messages:
    369
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    58
    #4
    thanks for answer. why it's better?
     
    Julia-IT-Inventors, May 29, 2006 IP
  5. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #5
    You want static .html or directory URLs. Why use mod_rewrite if you want .php URLs. That makes mod_rewrite worthless.
     
    Nintendo, May 29, 2006 IP