Mobile app version of vmapp.org
Login or Join

Login to follow query

More posts by @Annie201

1 Comments

Sorted by latest first Latest Oldest Best

 

@Jamie184

Try the following in .htaccess:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.*)DriveType:Flash:(.*)$
RewriteRule ^us/Product-Family/Products/c/Products/layout$ /[CO]?%1DriveType:Flash SSD:%2 [R=301,L]


This only matches the URL specified and externally redirects to the new URL. This could perhaps be made more efficient by restricting the pattern that will match before and after the required string. At the moment .* matches anything (and nothing).

In the RewriteRule substitution: [CO] is the entire string/URL matched by the RewriteRule pattern and %1 and %2 are the corresponding sub patterns in RewriteCond matched before and after the required string to replace.

Note that I've included the : at the end of the pattern to avoid a rewrite loop. If the pattern does not always end with a : then this will need to be changed.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme