Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default .htaccess ErrorDocument

    I'm using .htaccess for custom error pages and did this:
    Code:
    # Custom Errors
    ErrorDocument 401 /sitemap?err=401
    ErrorDocument 403 /sitemap?err=403
    ErrorDocument 404 /sitemap?err=404
    ErrorDocument 500 /sitemap?err=500
    When I go to say example.com/somepagethatdoesntexist

    it gives me a defaultl 404 with an additional 500 when the ErrorDocument failed...

    I don't know why this is. :/

    Edit: May aswell put in my other problem..
    The whole .htaccess is:
    Code:
    Options +FollowSymLinks
    Options +Indexes
    RewriteEngine On
    RewriteRule ^services services.php
    RewriteRule ^about about.php
    RewriteRule ^portfolio portfolio.php
    RewriteRule ^portfolio/([A-Za-z0-9]+)/([0-9]+)/?$ portfolio.php?c=$1&id=$2 [L]
    RewriteRule ^hosting hosting.php
    RewriteRule ^quote quote.php
    RewriteRule ^contact contact.php
    RewriteRule ^blog blog.php
    RewriteRule ^press press.php
    RewriteRule ^affiliations affiliations.php
    RewriteRule ^faqs faqs.php
    RewriteRule ^sitemap(.*) sitemap.php$1
    RewriteRule ^testimonials testimonials.php
    # Custom Errors
    ErrorDocument 401 /sitemap?err=401
    ErrorDocument 403 /sitemap?err=403
    ErrorDocument 404 /sitemap?err=404
    ErrorDocument 500 /sitemap?err=500
    Portfolio and the actual sitemap?err=500 don't work.. I get a 500 from them. /portfolio does but /portfolio/print/1 doesn't, with sitemap, /sitemap doesn't sitemap?err=x doesn't either.
    Last edited by Hypertext; 03-10-2008 at 09:52 PM.
    How could this hapen to meeeeeeeeeeeeeee?lol.

  2. #2
    Join Date
    Jul 2005
    Posts
    1,653
    Tokens
    50

    Latest Awards:

    Default

    Check your error log, are you sure you have a file called "sitemap" with no extension, because otherwise I'm pretty sure it won't work.

  3. #3
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    I have a file called sitemap.php, which is rerouted (look above) at

    Line 15: RewriteRule ^sitemap(.*) sitemap.php$1
    My theory was that sitemapanything would redirect to sitemap.phpanything as an example...
    How could this hapen to meeeeeeeeeeeeeee?lol.

  4. #4
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    I think what your trying to do is make it so its like what digg do, where its like digg.com/login?user=name&password=lol

    ye?

    If so,
    RewriteRule ^sitemap sitemap.php

    No need for the (.*) as htacccess just adds anything with ? onto the end of the php file.

  5. #5
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    Thanks.

    But I just decided to do /sitemap/404

    I'm using RewriteRule sitemap/(.*)$ /sitemap.php?err=$1 [L]
    but it isn't working.. it gets me to sitemap.php but doesn't append the $_GET var.

    Edit, got it, it was my PHP. :rolleyes: Sorry.
    Last edited by Hypertext; 05-10-2008 at 06:25 PM.
    How could this hapen to meeeeeeeeeeeeeee?lol.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •