SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Using a 301 redirect is causing a 404 error

    Does anyone have any idea why this rewriteRule works fine:


    # Redirect oil-testimonials.com/essential-oils/2657/lemon-oil-as-a-deodorant
    RewriteRule ^essential-oils/([0-9]+)/([a-zA-Z0-9\-]+)$ essential-oils.php?tID=$1 [L]


    But this produces a 404 error?


    # Redirect oil-testimonials.com/essential-oils/2657/lemon-oil-as-a-deodorant
    RewriteRule ^essential-oils/([0-9]+)/([a-zA-Z0-9\-]+)$ essential-oils.php?tID=$1 [R=301,L]


    The only difference is that the second one uses a 301 redirect. Very strange.

    Thanks!
    Convert your dollars into silver coins. www.convert2silver.com

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,645
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    bb,

    Curious; no reason here so there must be other code which is conflicting.

    Note: Do not escape the hyphen (the -) in the range definition regex; it should be first but does work as the last character (to match the hyphen character in the {REQUEST_URI} string.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Bookmarks

Posting Permissions

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