301 redirect from custom google search results appends extra slash

I am using the .htaccess file for a new websites 301 redirects to all the current urls.

All the redirects work fine but for some reason when clicking on a Google search result for one of the old URLS:

it redirects to the proper url, but then adds a slash at the end of the .htm extension like this:

which messes up the display of the page (as if no CSS styles are present). This only happens when clicking a search result. I’ve added a 301 redirect to solve the issue temporarily (so you can’t test it live right now). I have a feeling it’s a rewrite rule that’s doing it but I didn’t write those rules and don’t really understand them, this is what the .htaccess file has:

#Redirect to www location
RewriteEngine on
RewriteBase /
rewritecond %{http_host} ^assurx.com [nc]
rewriterule ^(.*)$ http://www.assurx.com/$1 [r=301,nc]

Can anyone clue me in?

sl,

What you’ve displayed will not redirect to “all current URLs” but the only things I can see wrong is the RewriteBase (where’s the Redirect it’s designed to UNDO for mod_rewrite?) and the lack of escape for the dot character in the RewriteCond. As a further comment, I’d just write the RewriteRule as

RewriteRule .? http://www.assurx.com%{REQUEST_URI} [R=301,L]

which retains the original URI - your No Case flag should NEVER be used on a {REQUEST_URI} variable.

Regards,

DK

Thanks david, I’ll see if that might be the problem.

I have anotrher .htaccess issue. One of the redirects isn’t working properly. this redirect line:

Redirect 301 /nerc/PRC005.html http://www.assurx.com/software-solutions/energy-utilities-enterprise.htm

results in this URL for some reason:

It’s appending the old html file name to the redirect URL. I have no idea why this is happening. Other redirects in the same .htaccess file work fine…

sl,

Quite obviously, there is NOTHING in your mod_alias code which would do that. Please show your entire .htaccess so we can see what’s causing the “interference.”

In your reply, though, please let us know if these redirections are in a directory co-located with assurx.com or how they’re related.

Regards,

DK

Thanks David

Here is the .htaccess file code. Sorry, lots of redirects, highlighted the relevant one. All the redirects are from the old version of the assurx.com domain site, which has been entirely replaced with a new site with a wholly different directory structure:

#Redirect to www location
RewriteEngine on
RewriteBase /
rewritecond %{http_host} ^assurx.com [nc]
RewriteRule .? http://www.assurx.com%{REQUEST_URI} [R=301,L]

AddType application/x-httpd-php .htm .html
AddType text/x-component .htc

Redirect 301 /AlyeskaCaseStudy.html http://www.assurx.com/resource-documents/case-studies/assurx-alyeska-pipeline-capa-compliance-story.pdf
Redirect 301 /AlyeskaCaseStudy2.html http://www.assurx.com/resource-documents/case-studies/assurx-alyeska-pipeline-capa-compliance-story.pdf
Redirect 301 /asqeed207.html http://www.assurx.com/assurx-events-conferences.htm
Redirect 301 /ASQMN.html http://www.assurx.com/assurx-events-conferences.htm
Redirect 301 /assurxonewebinar.html http://www.assurx.com/resource-center/webcast-replay-request.htm
Redirect 301 /ataglance.html http://www.assurx.com/product/features.htm
Redirect 301 /busproc.html http://www.assurx.com/services/professional-services.htm
Redirect 301 /CAPA.html http://www.assurx.com/software-solutions/capa-corrective-action.htm
Redirect 301 /capawhitepaper.html http://www.assurx.com/resource-center/whitepapers.htm
Redirect 301 /CAPAWhitepr.html http://www.assurx.com/resource-center/whitepapers.htm
Redirect 301 /catsweb.html http://www.assurx.com/product-technology-overview.htm
Redirect 301 /ChangeControl.html http://www.assurx.com/software-solutions/change-control-management.htm
Redirect 301 /classes.html http://www.assurx.com/services/training-education/course-schedule.htm
Redirect 301 /classes2009.html http://www.assurx.com/services/training-education/course-schedule.htm
Redirect 301 /company.html http://www.assurx.com/about-assurx.htm
Redirect 301 /complaintmgmt.html http://www.assurx.com/software-solutions/complaint-handling-management.htm
Redirect 301 /complaints/index.html http://www.assurx.com/software-solutions/complaint-handling-management.htm
Redirect 301 /complaints.html http://www.assurx.com/software-solutions/complaint-handling-management.htm
Redirect 301 /complaintsmatrix.html http://www.assurx.com/resource-center/whitepapers.htm
Redirect 301 /contact.html http://www.assurx.com/contact-assurx.htm
Redirect 301 /contact1.html http://www.assurx.com/contact-assurx.htm
Redirect 301 /corpstds.html http://www.assurx.com/resource-center/brand-guidelines.htm
Redirect 301 /custawrd.html http://www.assurx.com/resource-center/customer-success-stories.htm
Redirect 301 /customers.html http://www.assurx.com/assurx-customers.htm
Redirect 301 /custquote.html http://www.assurx.com/customer-testimonials.htm
Redirect 301 /custstud.html http://www.assurx.com/customer-case-studies.htm
Redirect 301 /cwoptions.html http://www.assurx.com/product/options.htm
Redirect 301 /dashmetrics.html http://www.assurx.com/product/features/dashboards-metrics.htm
Redirect 301 /demo.html http://www.assurx.com/resource-center/demo-info-request.htm
Redirect 301 /demoExpan.html http://www.assurx.com/resource-center/demo-info-request.htm
Redirect 301 /docuserv.html http://www.assurx.com/product/options.htm
Redirect 301 /downloads.html http://www.assurx.com/resource-center/brochures.htm
Redirect 301 /edhrwebinar.html http://www.assurx.com/resource-center/webcast-replay-request.htm
Redirect 301 /emdr/index.html http://www.assurx.com/software-solutions/emdr-software.htm
Redirect 301 /emdr.html http://www.assurx.com/software-solutions/emdr-software.htm
Redirect 301 /eMDRBrochure.html http://www.assurx.com/resource-center/brochures.htm
Redirect 301 /eMDRebook.html http://www.assurx.com/resource-center/whitepapers.htm
Redirect 301 /eMDRJune09Webinar.html http://www.assurx.com/resource-center/webcast-replay-request.htm
Redirect 301 /emdrmandatewhitepaper.html http://www.assurx.com/resource-center/whitepapers.htm
Redirect 301 /eMDRpaper.html http://www.assurx.com/resource-center/whitepapers.htm
Redirect 301 /eMDRSignup.html http://www.assurx.com/resource-center/webcast-replay-request.htm
Redirect 301 /eMDRstatusreport.html http://www.assurx.com/software-solutions/emdr-software.htm
Redirect 301 /eMDRupdate.html http://www.assurx.com/software-solutions/emdr-software.htm
Redirect 301 /eMDRWebinar.html http://www.assurx.com/resource-center/webcast-replay-request.htm
Redirect 301 /Euci061008.html http://www.assurx.com/assurx-events-conferences.htm
Redirect 301 /event.html http://www.assurx.com/assurx-events-conferences.htm
Redirect 301 /fda.html http://www.assurx.com/software-solutions/compliance-management-software/fda-compliance.htm
Redirect 301 /fda483.html http://www.assurx.com/software-solutions/compliance-management-software/fda-compliance.htm
Redirect 301 /FDAFoodSafetyISO22000.html http://www.assurx.com/software-solutions/compliance-management-software/food-safety-haccp-compliance.htm
Redirect 301 /FDAImporterGuidanceWhitePaper.html http://www.assurx.com/resource-center/whitepapers.htm
Redirect 301 /fdalegal.html http://www.assurx.com/resource-center/whitepapers.htm
Redirect 301 /fdalegalpaper.html http://www.assurx.com/resource-center/whitepapers.htm
Redirect 301 /fdanews483.html http://www.assurx.com/resource-center/whitepapers.htm
Redirect 301 /finance.html http://www.assurx.com/industries/finance-insurance-providers.htm
Redirect 301 /foodsafetypaper.html http://www.assurx.com/resource-center/whitepapers.htm
Redirect 301 /forIT.html http://www.assurx.com/quality-compliance-software-solutions.htm
Redirect 301 /GDTaward.html http://www.assurx.com/customer-case-studies.htm
Redirect 301 /hostedsol.html http://www.assurx.com/software-solutions/saas-ondemand-solutions.htm
Redirect 301 /HutchCaseStudy.html http://www.assurx.com/resource-documents/case-studies/assurx-hutchinson-technology-capa-ncr-story.pdf
Redirect 301 /InterphexWestCoast.html http://www.assurx.com/assurx-events-conferences.htm
Redirect 301 /jobs.html http://www.assurx.com/careers-assurx.htm
Redirect 301 /legal.html http://www.assurx.com/legal-notice.htm
Redirect 301 /LSSiginfo.html http://www.assurx.com/assurx-events-conferences.htm
Redirect 301 /LSSIGsignup.html http://www.assurx.com/assurx-events-conferences.htm
Redirect 301 /LSSIGsignupb.html http://www.assurx.com/assurx-events-conferences.htm
Redirect 301 /managecomplaints.html http://www.assurx.com/software-solutions/complaint-handling-management.htm
Redirect 301 /MDRWebinar.html http://www.assurx.com/resource-center/webcast-replay-request.htm
Redirect 301 /MDRWebinarInfo.html http://www.assurx.com/resource-center/webcast-replay-request.htm
Redirect 301 /MercuryWebinar.html http://www.assurx.com/resource-center/webcast-replay-request.htm
Redirect 301 /MercuryWebinarInfo.html http://www.assurx.com/resource-center/webcast-replay-request.htm
Redirect 301 /nerc/ http://www.assurx.com/software-solutions/energy-utilities-enterprise.htm
Redirect 301 /nerc/assurxone.html http://www.assurx.com/software-solutions/compliance-management-software/utility-nerc-compliance-assurxone.htm
Redirect 301 /nerc/demo.html http://www.assurx.com/resource-center/demo-info-request.htm
Redirect 301 /nerc/ElectronicSignaturesAuditTrail.html http://www.assurx.com/software-solutions/energy-utilities-enterprise.htm
Redirect 301 /nerc/ERBroWP.html http://www.assurx.com/resource-center/whitepapers.htm
Redirect 301 /nerc/ERSIGSignupChicago.html http://www.assurx.com/assurx-events-conferences.htm
Redirect 301 /nerc/ERSIGSignupInfoChicago.html http://www.assurx.com/assurx-events-conferences.htm
Redirect 301 /nerc/index.html http://www.assurx.com/software-solutions/energy-utilities-enterprise.htm
Redirect 301 /nerc/NERC-CIP.html http://www.assurx.com/software-solutions/energy-utilities-enterprise.htm
Redirect 301 /nerc/nerc.html http://www.assurx.com/software-solutions/energy-utilities-enterprise.htm
Redirect 301 /nerc/NERCGridWP.html http://www.assurx.com/resource-center/whitepapers.htm
[COLOR="#FF0000"]Redirect 301 /nerc/PRC005.html http://www.assurx.com/software-solutions/energy-utilities-enterprise.htm[/COLOR]
Redirect 301 /nerc/ucinfo.html http://www.assurx.com/assurx-events-conferences.htm
Redirect 301 /nerc/ucsignup.html http://www.assurx.com/assurx-events-conferences.htm
Redirect 301 /NERC.html http://www.assurx.com/software-solutions/energy-utilities-enterprise.htm
Redirect 301 /NERCAuditWebinar.html http://www.assurx.com/resource-center/webcast-replay-request.htm
Redirect 301 /NERCCIPSignup.html http://www.assurx.com/resource-center/webcast-replay-request.htm
Redirect 301 /NERCSignup.html http://www.assurx.com/resource-center/webcast-replay-request.htm
Redirect 301 /NERCStrategiesWebinar.html http://www.assurx.com/resource-center/webcast-replay-request.htm
Redirect 301 /NERCWebinar.html http://www.assurx.com/resource-center/webcast-replay-request.htm
Redirect 301 /NERCWebinarInfo.html http://www.assurx.com/resource-center/webcast-replay-request.htm
Redirect 301 /news.html http://www.assurx.com/assurx-news.htm
Redirect 301 /newsarchives.html http://www.assurx.com/assurx-news.htm
Redirect 301 /ondemand/30daytrial.html http://www.assurx.com/resource-center/demo-info-request.htm
Redirect 301 /ondemand/ataglanceOD.html http://www.assurx.com/software-solutions/saas-ondemand-solutions.htm
Redirect 301 /ondemand/demoOnDemand.html http://www.assurx.com/resource-center/demo-info-request.htm
Redirect 301 /ondemand/index.html http://www.assurx.com/software-solutions/saas-ondemand-solutions.htm
Redirect 301 /ondemand/odoverview.html http://www.assurx.com/software-solutions/saas-ondemand-solutions.htm
Redirect 301 /ondemand/preconfig.html http://www.assurx.com/software-solutions/saas-ondemand-solutions.htm
Redirect 301 /partnerlogin.html http://www.assurx.com/assurx-partners.htm
Redirect 301 /partners.html http://www.assurx.com/assurx-partners.htm
Redirect 301 /privacy.html http://www.assurx.com/privacy.htm
Redirect 301 /profservices.html http://www.assurx.com/services/professional-services.htm
Redirect 301 /profservices1.html http://www.assurx.com/services/professional-services.htm
Redirect 301 /QAGalderma.html http://www.assurx.com/resource-center/customer-success-stories.htm
Redirect 301 /QMSPaperPR.html http://www.assurx.com/resource-center/whitepapers.htm
Redirect 301 /recmgmt.html http://www.assurx.com/product/options.htm#records-management
Redirect 301 /recmgmtpaper.html http://www.assurx.com/resource-center/whitepapers.htm
Redirect 301 /sarbox.html http://www.assurx.com/software-solutions/compliance-management-software/financial-sarbanes-compliance.htm
Redirect 301 /Search.html http://www.assurx.com/product/features/full-text-search.htm
Redirect 301 /services.html http://www.assurx.com/services/professional-services.htm
Redirect 301 /sitemap.html http://www.assurx.com/site-map.htm
Redirect 301 /solutions.html http://www.assurx.com/quality-compliance-software-solutions.htm
Redirect 301 /SQM.html http://www.assurx.com/software-solutions/supplier-quality-management.htm
Redirect 301 /SQMpr.html http://www.assurx.com/software-solutions/supplier-quality-management.htm
Redirect 301 /SQMSignup.html http://www.assurx.com/resource-center/webcast-replay-request.htm
Redirect 301 /SQMWebinar.html http://www.assurx.com/resource-center/webcast-replay-request.htm
Redirect 301 /summit2003.html http://www.assurx.com/assurx-events-conferences.htm
Redirect 301 /summit2004.html http://www.assurx.com/assurx-events-conferences.htm
Redirect 301 /summit2006.html http://www.assurx.com/assurx-events-conferences.htm
Redirect 301 /summit2007.html http://www.assurx.com/assurx-events-conferences.htm
Redirect 301 /sysdeploy.html http://www.assurx.com/services/professional-services.htm
Redirect 301 /sysreq.html http://www.assurx.com/services/tech-support.htm
Redirect 301 /syssupp.html http://www.assurx.com/services/tech-support.htm
Redirect 301 /traindir.html http://www.assurx.com/services/training-education/catsweb-college-directions.htm
Redirect 301 /trainform.html http://www.assurx.com/services/training-education/training-request.htm
Redirect 301 /training.html http://www.assurx.com/services/training-education.htm
Redirect 301 /validation.html http://www.assurx.com/services/professional-services.htm
Redirect 301 /webservices.html http://www.assurx.com/product/features.htm
Redirect 301 /whitepapers.html http://www.assurx.com/resource-center/whitepapers.htm

It only seems to be an issue with redirects from the old /nerc/ subdirectory, that does not exist anymore, all the other redirects work as expected.

Aha!

Order is everything (with a computer)!

Your /nerc/ redirect comes before your other /nerc/{whatever} redirects so it will redirect before getting to the /newc/PRC005.html redirection. Saying that, the redirection you’ve described should still not have occurred (the other ones, like the one to /resource-center/whitepapers.htm can not occur) and the mod_rewrite will never take place because all the Redirects appear to be to http://www.assurx.com/{yadda-yadda}.

Regards,

DK

YES!!! Thank you, that was the issue, the general /nerc/ directory redirect should have been last. Now all are working fine. Thank you so much for taking the time to help me out. lesson learned!

sl,

No problem. It’s simple coding logic which has a major effect with mod_rewrite redirections so I’m used to looking for such “conflicts” in code when the redirections are not what’s expected.

Regards,

DK