#1
  1. A Change of Season
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,558
    Rep Power
    222

    Simple htaccess question


    Hi;

    I have a simple htaccess that doesn't really work properly with 404!

    What am I doing wrong?

    Code:
    RewriteEngine on
    
    DirectoryIndex page.php?id=1
    
    RewriteRule ^free-vide47$ page.php?id=1
    
    RewriteRule ^free-video67$ page.php?id=2
    
    RewriteRule ^free-video97$ page.php?id=3
    
    ErrorDocument 404 /page.php?id=1
    Thanks
    Last edited by English Breakfast Tea; July 10th, 2016 at 07:46 AM.
  2. #2
  3. Headless Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,977
    Rep Power
    9647
    Does that DirectoryIndex actually work? I wouldn't think so, but the docs aren't clear on whether it is allowed or not.

    What does "doesn't really work properly" mean?
  4. #3
  5. A Change of Season
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,558
    Rep Power
    222
    Originally Posted by requinix
    Does that DirectoryIndex actually work? I wouldn't think so, but the docs aren't clear on whether it is allowed or not.

    What does "doesn't really work properly" mean?
    Code:
    Not Found
    
    The requested URL /site/offe was not found on this server.
    
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
  6. #4
  7. Headless Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,977
    Rep Power
    9647
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    means it knew about your ErrorDocument but couldn't find the file it was referring to...
  8. #5
  9. A Change of Season
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,558
    Rep Power
    222
    Originally Posted by requinix
    means it knew about your ErrorDocument but couldn't find the file it was referring to...
    I can access http://localhost:8888/site/page.php?id=1 manually when I put it in the address bar.
  10. #6
  11. Headless Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,977
    Rep Power
    9647
    Leading slashes always mean the path is relative to the document root. Not the current directory.

IMN logo majestic logo threadwatch logo seochat tools logo