Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 26th, 2012  |  syntax: None  |  size: 0.92 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Regular Expression - minus/hyphen character issue
  2. /4-new-south-wales/499-some-category.html
  3.        
  4. RewriteRule (.*)d+-(.*) $1$2 [R=301,L]
  5.        
  6. /4-new-south-wales-nsw/49cross-breeds-designer-dogs.html
  7.        
  8. /a/b/c/4-new-south-wales-nsw/49123123-cross-breeds-designer-dogs.html
  9.        
  10. /a/b/c/new-south-wales-nsw/cross-breeds-designer-dogs.html
  11.        
  12. RewriteRule (.*?)d+-(.*?)d+-(.*) $1$2$3 [R=301,L]
  13.        
  14. (/.*/)d+-(.*)
  15.        
  16. <IfModule mod_rewrite.c>
  17.     RewriteEngine on
  18.  
  19.     # Set RewriteBase to the URL-path containing this .htaccess file:
  20.     RewriteBase /apache
  21.  
  22.     # Redirect first "/ddd-XXX" path segment to: "/XXX":
  23.     RewriteRule ^((?:(?!d+-)[^/]+/)*)d+-(.*)$ $1$2 [R=301,L]
  24.  
  25.     # Rewrite the resulting URL path to show.php as a query string
  26.     # (if resulting URL-path is NOT a real file or a directory).
  27.     RewriteCond %{REQUEST_FILENAME} !-f
  28.     RewriteCond %{REQUEST_FILENAME} !-d
  29.     RewriteRule ^(.+)$ show.php?path=$1
  30.  
  31. </IfModule>