Forum Moderators: phranque
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^webPages\/choosing_service_why_choose_service\.html$ "http\:\/\/example\.com\/Choosing\-Service\/will_filing_service_in_ohio_help_me\.html" [R=301,L]
# Google Analytics Integration - Added by cPanel.
<IfModule mod_substitute.c>
AddOutputFilterByType SUBSTITUTE text/html
Substitute "s|(<script type='text/javascript' src='/google_analytics_auto.js'></script>)?</head>|<script src='/google_analytics_auto.js'></script></head>|i"
</IfModule>
# END Google Analytics Integration
My question is, should I start from scratch erase all .htaccess code, keeping a back of course, and write it correctYes.
I believe it's apacheIf you're using htaccess, it's apache. Other server languages (IIS, Nginx) call it by different names and the syntax is entirely different. You don't generally need to know the underlying operating system (Linux, for example).
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^webPages\/choosing_service_why_choose_service\.html$ "http\:\/\/example\.com\/Choosing\-Service\/will_filing_service_in_ohio_help_me\.html" [R=301,L]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^webPages\/choosing_service_why_choose_service\.html$ "https\:\/\/example\.com\/Choosing\-Service\/will_filing_service_in_ohio_help_me\.html" [R=301,L]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^webPages\/choosing_service_why_choose_service\.html$ "https://www.example.com/Choosing-Service/will_filing_service_in_ohio_help_me.html" [R=301,L]
RewriteCond %{HTTP_HOST} ^example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$The first two are irrelevant on any single-site htaccess--and even on a multi-site htaccess they're badly worded. The second two are simply not needed. (They're also execrably written. Did somebody at cPanel throw together some code back in 2002, never to be looked at again?) RewriteRule ^webPages\/choosing_service_why_choose_service\.html$ "https://www.example.com/Choosing-Service/will_filing_service_in_ohio_help_me.html" [R=301,L]I swear I've said this before. Was it in someone else's thread?