.htaccess - 301 RedirectMatch - Issue -


i posted question here got answer for, i've identified issue code.

original question:

301 redirectmatch - many urls

rewriterule ^([^-]+)-([^-]+)-(?!in)([^/]+)-([^-]{2})\.html$ /$1-$2-in-$3-$4.html [r=301,l] rewriterule ^([^-]+)-([^-]+)-(?!in)([^/]+)\.html$ /$1-$2-in-$3.html [r=301,l] 

while above fixed issues urls, noticed normal urls having issues. example, domain.com/careers-jobs-music-degree.html turning domain.com/careers-jobs-in-music-degree.html - 'in' being added other urls don't have 'music-classes' in url. there way prevent this?

thanks!

you can try rules way real urls shouldn't affected.

rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([^-]+)-([^-]+)-(?!in)([^/]+)-([^-]{2})\.html$ /$1-$2-in-$3-$4.html [r=301,l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([^-]+)-([^-]+)-(?!in)([^/]+)\.html$ /$1-$2-in-$3.html [r=301,l] 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -