Results 1 to 3 of 3
  1. #1
    Grandma broke her coccyx! Uncle Rico's Avatar
    Join Date
    May 8th, 2007
    Location
    North Carolina
    Posts
    2,238
    RewriteRule htaccess Help
    I am trying to streamlime a RewriteRule in my .htaccess file to make it more efficient.

    I am trying to rewrite these situations into a single rule that will catch all....

    Code:
    text1-example.php --------------->rewrite to something
    text1_text2-example.php --------->rewrite to something
    text1_text2_text3-example.php --->rewrite to something
    I can't seem to get these 3 variations into a single regex that will work in all cases.

  2. #2
    Full Member
    Join Date
    January 18th, 2005
    Location
    Moved, Asia
    Posts
    400
    I hope this example may meet your needs:
    http://www.shadow-fox.net/site/tutor...-PHP-Functions
    IRS
    Don't ask why the ball doesn't come.

  3. #3
    Grandma broke her coccyx! Uncle Rico's Avatar
    Join Date
    May 8th, 2007
    Location
    North Carolina
    Posts
    2,238
    I found the correct expression. So simple is hurts.

    Code:
    RewriteRule   ^(.+)-example.php?$  newexample\.php?a=$1 [L]

  4. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Need help with .htaccess
    By womanht in forum Programming / Datafeeds / Tools
    Replies: 5
    Last Post: February 17th, 2011, 10:30 PM
  2. Any .htaccess rewriterule Gurus around?
    By Uncle Rico in forum Programming / Datafeeds / Tools
    Replies: 2
    Last Post: August 24th, 2008, 08:20 AM
  3. htaccess help
    By John Kruger in forum Programming / Datafeeds / Tools
    Replies: 13
    Last Post: February 8th, 2008, 10:20 AM
  4. RewriteRule
    By mmcbee in forum Cusimano.com Scripts
    Replies: 6
    Last Post: May 19th, 2005, 09:09 PM

Posting Permissions

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