
Untitled
By: a guest on
May 26th, 2012 | syntax:
None | size: 0.92 KB | hits: 14 | expires: Never
Regular Expression - minus/hyphen character issue
/4-new-south-wales/499-some-category.html
RewriteRule (.*)d+-(.*) $1$2 [R=301,L]
/4-new-south-wales-nsw/49cross-breeds-designer-dogs.html
/a/b/c/4-new-south-wales-nsw/49123123-cross-breeds-designer-dogs.html
/a/b/c/new-south-wales-nsw/cross-breeds-designer-dogs.html
RewriteRule (.*?)d+-(.*?)d+-(.*) $1$2$3 [R=301,L]
(/.*/)d+-(.*)
<IfModule mod_rewrite.c>
RewriteEngine on
# Set RewriteBase to the URL-path containing this .htaccess file:
RewriteBase /apache
# Redirect first "/ddd-XXX" path segment to: "/XXX":
RewriteRule ^((?:(?!d+-)[^/]+/)*)d+-(.*)$ $1$2 [R=301,L]
# Rewrite the resulting URL path to show.php as a query string
# (if resulting URL-path is NOT a real file or a directory).
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ show.php?path=$1
</IfModule>