1

Hello I am trying to do a regular expression for an apache rewrite rule that handle request with no slash at the end and no extension

an example https://www.some.thing.com/life-health-insurance

Here is what I have below but I feel that it's not 100% working correctly

RewriteCond %{HTTP_HOST} ^www.some.thing.com$ [OR] RewriteCond %{HTTPS_HOST} ^www.some.thing.com$ RewriteCond %{REQUEST_URI} !^/cap-iw-webtest RewriteCond %{REQUEST_URI} !^/content/dam/.* RewriteCond %{REQUEST_URI} !.*\..*$ RewriteCond %{REQUEST_URI} !.*/$ RewriteRule (.*)$ $1/ [R=301,QSA]

My concern is with the RewriteRule (.*)$ not sure if this handles what I am trying to do?

  • Have you looked at the RewriteLog file? I suggest around level 3 or 4. – roaima Mar 29 '17 at 21:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.