1

Having an issue with htaccess redirects adding parameters to the new locations. I have done some research on this and apparently its from the default htaccess rules. I have tried a few suggestions which fixes it, but then I run into another issue where all of my channels load without www so none of the css or scripts load. I have a redirect to redirect all non www to www, but for some reason it must be conflicting with my rules because it will not redirect the channels.

Here is my redirect code

<IfModule mod_rewrite.c>
RewriteEngine On
#only way the below redirects work without the parameter
RewriteRule (.+) index.php [QSA,L]

Redirect 301 /services/ http://www.domain.com/healthcare-it-services/
Redirect 301 /services/optimization/ http://www.domain.com/healthcare-it-services/optimization/
Redirect 301 /services/insurance-authorization/ http://www.domain.com/healthcare-it-services/insurance-authorization/
Redirect 301 /solutions/ http://www.domain.com/healthcare-it-solutions/
Redirect 301 /solutions/schedule-maximizer/ http://www.domain.com/healthcare-it-solutions/schedule-maximizer/
Redirect 301 /solutions/provider-network-manager/  http://www.domain.com/healthcare-it-solutions/provider-network-manager/

# send any asp page back to home
#RewriteRule \.asp$ http://domain.com [R=301,L]

RewriteCond %{HTTP_HOST} ^domain.com$
RewriteRule (.*) http://www.domain.com/$1 [R=301,L] 

# Send would-be 404 requests to Craft
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
RewriteRule (.+) index.php?p=$1 [QSA,L]
</IfModule>
1

I was having a similar issue. Combining your use of:

RewriteRule (.+) index.php [QSA,L]

but with the following for the non-www redirect

RewriteCond %{HTTP_HOST} =www.domain.com
RewriteRule (.*) http://domain.com/$1 [R=302,L]

worked for me.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.