Thank you, once I get everything redirecting properly I will append my http.conf file.
Smart move! Not many webmasters are aware of the stress on the server to continually read and parse (and re-parse) lengthy .htaccess files. As I just told DD in her thread, .htaccess is a directory resource for "junior" webmasters (not using VPS or dedicated servers). When "junior" starts to get knowledgeable, he/she will keep adding "niceties" until the file gets to be a burden on the server. While it should cause "junior" to be removed from shared servers, I've not heard of anyone being booted - but it SHOULD be done to protect webmasters sharing the server. Okay, VPS and dedicated webmasters should only use .htaccess to test new code before moving to the server (or virtual host) configuration files, too.
Ok so I'll have to remove RewriteBase for this search.asp to work? This .htaccess file is the default that comes with installing the MODX CMS, so I'm a little wary of tweaking anything unless you literally spell it out for me where I can copy/paste the code to test (and have a backup of course
The WP people use RewriteBase, too, but they do so because they write to the DocumentRoot's .htaccess while allowing WP to be installed in a subdirectory which is where RewriteBase comes in (to offset the base location of the WP code). Confused yet? If you're using RewriteBase /, you just don't need it.
I've updated that section of code to remove the extra period, and as you said from the above point its not working because of Rewrite Base. What exact changes do you suggest I do to the below code, while being careful to allow the MODX CMS to still have the rewrite code it needs to work. If you have a paypal account I'd love to buy you a case of beer or a puppy.
I've never refused a gift but won't post my PayPal account here. I'm not here for profit, though, only to share the knowledge (and hope that others would continue this tradition to raise the bar for everyone).
Code:
# MODX supports Friendly URLs via this .htaccess file. You must serve web
# pages via Apache with mod_rewrite to use this functionality, and you must
# change the file name from ht.access to .htaccess.
#
# Make sure RewriteBase points to the directory where you installed MODX.
# E.g., "/modx" if your installation is in a "modx" subdirectory.
#
# You may choose to make your URLs non-case-sensitive by adding a NC directive
# to your rule: RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]
RewriteEngine On
RewriteBase /
# Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
#RewriteCond %{HTTP_HOST} .
#RewriteCond %{HTTP_HOST} !^example-domain-please-change\.com [NC]
#RewriteRule (.*) http://example-domain-please-change.com/$1 [R=301,L]
#
# or for the opposite domain.com -> www.domain.com use the following
# DO NOT USE BOTH
#
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.newhair\.com [NC]
# RewriteRule (.*) http://www.newhair.com/$1 [R=301,L]
RewriteRule .? http://www.newhair.com%{REQUEST_URI} [R=301,L]
# Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent
# https://www.domain.com when your cert only allows https://secure.domain.com
#RewriteCond %{SERVER_PORT} !^443
#RewriteRule (.*) https://example-domain-please-change.com.com/$1 [R=301,L]
RewriteRule ^treatment/fue-fox-megasession.asp$ fue-megasession.html [R=301,L]
RewriteRule ^fue2/$ fue2.html [R=301,L]
RewriteRule ^fue/$ fue-introduction-to-follicular-unit-extraction-techniques.html [R=301,L]
RewriteRule ^treatment/fut-automated-devices.asp$ automated-devices.html [R=301,L]
RewriteRule ^treatment/fut-treating-women.asp$ treating-women.html [R=301,L]
RewriteRule ^treatment/fut-racial-variations.asp$ racial-variations.html [R=301,L]
RewriteRule ^treatment/fut-megasessions.asp$ megasessions.html [R=301,L]
RewriteRule ^treatment/fut-fast-track-method.asp$ nhi-fast-track%C2%AE-method.html [R=301,L]
RewriteRule ^treatment/fut-suturing-techniques.asp$ suturing-techniques.html [R=301,L]
RewriteRule ^treatment/fut-follicular-units.asp$ follicular-units.html [R=301,L]
RewriteRule ^treatment/fut-microscopic-dissection.asp$ stereo-microscopic-dissection.html [R=301,L]
RewriteRule ^treatment/fut-single-strip-harvesting.asp$ single-strip-harvesting.html [R=301,L]
RewriteRule ^treatment/fut-nhi-master-plan.asp$ nhi-master-plan.html [R=301,L]
RewriteRule ^treatment/follicular-unit-transplants.asp$ follicular-unit-transplants.html [R=301,L]
RewriteRule ^treatment/basics-post-op.asp$ post-op-course-in-follicular-unit-transplantation.html [R=301,L]
RewriteRule ^treatment/basics-procedure.asp$ understanding-the-procedure.html [R=301,L]
RewriteRule ^treatment/basics-overview.asp$ an-overview-of-hair-transplantation.html [R=301,L]
RewriteRule ^treatment/hair-transplant-basics.asp$ hair-transplant-basics.html [R=301,L]
RewriteRule ^treatment/index.asp$ getting-started/ [R=301,L]
RewriteRule ^info/contact.asp$ contact-information.html [R=301,L]
RewriteRule ^info/news-views.asp$ 2004-golden-follicle-award.html [R=301,L]
RewriteRule ^info/doctor-pak.asp$ jae-pak-m.d.html [R=301,L]
RewriteRule ^info/doctor-rassman.asp$ william-r.-rassman-m.d.html [R=301,L]
RewriteRule ^info/hair-doctors.asp$ about-us/ [R=301,L]
RewriteRule ^info/history-timeline.asp$ nhi-timeline.html [R=301,L]
RewriteRule ^info/history.asp$ history-of-nhi.html [R=301,L]
RewriteRule ^info/nhi-way.asp$ the-nhi-way.html [R=301,L]
RewriteRule ^info/events.asp$ upcoming-events.html [R=301,L]
RewriteRule ^info/index.asp$ about-us/ [R=301,L]
RewriteRule ^next/hair-loss-questions-faq.asp$ faq.html [R=301,L]
RewriteRule ^fees/$ fees-and-financing.html [R=301,L]
RewriteRule ^next/request-info.asp$ contact-information.html [R=301,L]
RewriteRule ^next/consultation.asp$ schedule-a-consultation.html [R=301,L]
RewriteRule ^next/hair-transplant-videos.asp?fl=no$ videos/ [R=301,L]
RewriteRule ^next/repair-story-dean.asp$ procedure-1-the-surgery-page-1.html [R=301,L]
RewriteRule ^next/other-photo-gallery.asp$ other-hair-restoration-photos/
RewriteRule ^next/repair-photo-gallery.asp$ repair-work-photos/
RewriteRule ^next/hairline-photo-gallery.asp$ hairline-photos/
RewriteRule ^next/full-face-photo-gallery.asp$ full-face-photos/
RewriteRule ^next/hair-restoration-photos.asp$ gallery/ [R=301,L]
RewriteRule ^resources/links.asp$ expert-links.html [R=301,L]
RewriteRule ^resources/nhi-newsletters.asp$ nhi-newsletters.html [R=301,L]
RewriteRule ^resources/medical-publications.asp$ follicular-transplantation-patient-evaluation-and-surgical-planning.html [R=301,L]
RewriteRule ^resources/hair-loss-in-women.asp$ hair-loss-in-women.html [R=301,L]
RewriteRule ^resources/assessing-hair-loss.asp$ assessing-hair-loss.html [R=301,L]
RewriteRule ^resources/hair-loss-causes.asp$ causes-of-hair-loss.html [R=301,L]
RewriteRule ^resources/index.asp$ expert-resources/ [R=301,L]
RewriteRule ^treatment/other-laser-therapy.asp$ laser-hair-transplants.html [R=301,L]
RewriteRule ^treatment/other-cosmetic-camouflage.asp$ cosmetic-camouflage.html [R=301,L]
RewriteRule ^treatment/other-hair-systems.asp$ hair-systems.html [R=301,L]
RewriteRule ^treatment/other-tissue-expansion.asp$ tissue-expansion.html [R=301,L]
RewriteRule ^treatment/other-flaps.asp$ flaps.html [R=301,L]
RewriteRule ^treatment/other-scalp-reductions.asp$ scalp-reductions.html [R=301,L]
RewriteRule ^treatment/other-laser-hair-transplants.asp$ low-laser-light-therapy-for-hair-loss.html [R=301,L]
RewriteRule ^treatment/other-plug-grafts.asp$ plug-type-grafts.html [R=301,L]
RewriteRule ^treatment/other-dilators.asp$ dilators.html [R=301,L]
RewriteRule ^treatment/other-mini-micrografting.asp$ mini-micrografting.html [R=301,L]
RewriteRule ^treatment/other-cloning-hair.asp$ cloning-hair.html [R=301,L]
RewriteRule ^treatment/other-medications.asp$ medications.html [R=301,L]
RewriteRule ^treatment/other-hair-loss-treatments.asp$ low-laser-light-therapy-for-hair-loss.html [R=301,L]
RewriteRule ^treatment/corrective-fix-scarred-area.asp$ scarred-areas.html [R=301,L]
RewriteRule ^treatment/corrective-repair-scalp-reduction.asp$ scalp-reductions.html [R=301,L]
RewriteRule ^treatment/corrective-hide-large-grafts.asp$ camouflaging-large-grafts.html [R=301,L]
RewriteRule ^treatment/corrective-repair-strategies.asp$ repair-strategies.html [R=301,L]
RewriteRule ^treatment/corrective-wasted-donor-hair.asp$ wasted-donor-hair.html [R=301,L]
RewriteRule ^treatment/corrective-fix-old-plugs.asp$ fixing-old-plugs.html [R=301,L]
RewriteRule ^treatment/corrective-procedures.asp$ fixing-old-plugs.html [R=301,L]
RewriteRule ^next/repair-story-dean-101.asp$ procedure-1-the-surgery-page-1.html [R=301,L]
RewriteRule ^next/repair-story-dean-101a.asp$ procedure-1-the-surgery-page-2.html [R=301,L]
RewriteRule ^next/repair-story-dean-101b.asp$ procedure-1-the-surgery-page-3.html [R=301,L]
RewriteRule ^next/repair-story-dean-101c.asp$ procedure-1-the-surgery-page-4.html [R=301,L]
RewriteRule ^next/repair-story-dean-101d.asp$ procedure-1-the-surgery-page-5.html [R=301,L]
RewriteRule ^next/repair-story-dean-102.asp$ procedure-1-9-days-after.html [R=301,L]
RewriteRule ^next/repair-story-dean-103.asp$ procedure-1-16-days-after.html [R=301,L]
RewriteRule ^next/repair-story-dean-104.asp$ procedure-1-23-days-after.html [R=301,L]
RewriteRule ^next/repair-story-dean-105.asp$ procedure-1-60-days-after.html [R=301,L]
RewriteRule ^next/repair-story-dean-201.asp$ procedure-2-the-surgery-page-1.html [R=301,L]
RewriteRule ^next/repair-story-dean-201a.asp$ procedure-2-the-surgery-page-2.html [R=301,L]
RewriteRule ^next/repair-story-dean-201b.asp$ procedure-2-the-surgery-page-3.html [R=301,L]
RewriteRule ^next/repair-story-dean-201c.asp$ procedure-2-the-surgery-page-4.html [R=301,L]
RewriteRule ^next/repair-story-dean-201d.asp$ procedure-2-the-surgery-page-5.html [R=301,L]
RewriteRule ^next/repair-story-dean-201e.asp$ procedure-2-the-surgery-page-6.html [R=301,L]
RewriteRule ^next/repair-story-dean-202.asp$ procedure-2-21-days-after.html [R=301,L]
RewriteRule ^next/repair-story-dean-203.asp$ procedure-2-35-days-after.html [R=301,L]
RewriteRule ^next/repair-story-dean-204.asp$ procedure-2-6-weeks-after.html [R=301,L]
RewriteRule ^next/repair-story-dean-205.asp$ procedure-2-2-months-after.html [R=301,L]
RewriteRule ^next/repair-story-dean-301.asp$ procedure-3-the-surgery-page-1.html [R=301,L]
RewriteRule ^next/repair-story-dean-301a.asp$ procedure-3-the-surgery-page-2.html [R=301,L]
RewriteRule ^next/repair-story-dean-301b.asp$ procedure-3-the-surgery-page-3.html [R=301,L]
RewriteRule ^next/repair-story-dean-301c.asp$ procedure-3-the-surgery-page-4.html [R=301,L]
RewriteRule ^next/repair-story-dean-301d.asp$ procedure-3-the-surgery-page-5.html [R=301,L]
RewriteRule ^next/repair-story-dean-301e.asp$ procedure-3-the-surgery-page-6.html [R=301,L]
RewriteRule ^next/repair-story-dean-301f.asp$ procedure-3-the-surgery-page-7.html [R=301,L]
RewriteRule ^next/repair-story-dean-301g.asp$ procedure-3-the-surgery-page-8.html [R=301,L]
RewriteRule ^next/repair-story-dean-301h.asp$ procedure-3-the-surgery-page-9.html [R=301,L]
RewriteRule ^next/repair-story-dean-301i.asp$ procedure-3-the-surgery-page-10.html [R=301,L]
RewriteRule ^next/repair-story-dean-302.asp$ procedure-3-6-months-after.html [R=301,L]
RewriteRule ^next/repair-story-dean-303.asp$ procedure-3-summary.html [R=301,L]
RewriteRule ^search/search\.asp$ search.html [R=301,L]
RewriteCond %{QUERY_STRING} ^pt=(ao|az|bf|bi|cc|cf|ck|ec|ec2|ej|es|fc|fc2|gc|gi|go|gq|iz|jq|ki|lf|lk|ll|ml|oi|ql|qq|rd|rf|si|uq|zu|aq|as|bi|cz|is|jg|jh|ji|kl|kq|le|lz|oi|qb|qi|ri|sz|ul|vi|vq|zo|bf|jq|li|or|wr|bg|rq|uk|ll|ru|mja|mjb|ai|aq|av|ba|bl|cq|cq2|ei|ek|eq|fi|fr|gf|gi|gr|hl|if|iq|is|jd|jq|jq2|ki|ko|lb|lc|lc2|lj|lr|lu|ma|ni|od|oj|qa|qi|qk|qo|qs|ri|ri2|rm|rq|su|vg|vs|vv|xg|xw|zf|ng|ds|bb|nh|vt|nk|gg|sk|et|cl|at|dk|us|cs|dd|hq|kg|ok|gk|mu|lx|dl|sq|dm|qt|cm|bn|bt|df|mt|xl|xk|tm|vl|cb|gn|dn|gb|qe|sv|nq|cd|xj|td|ik|be|kb|kk|lt|lv|mn|no|ts|cg|db|dt|ee|ef|eu|ft|ic|iu|mj|de|en|nn|ws|mk|xma|th|mc|do|tv|it|dp|ct|tt|ks|ns|tw|tu|dq|nf|ce|aj|uo|eo|el|nt|xs|gp|iv|ktb|eb|nu|tx|ir|te|tl|ch|qf|lg|kp|nj|nl|ci|ld|np|tg|ou|gs|tda|ttc|tn|tc|tuh|sc|oh|os|on|nqb|nkb|nx|ms|me|lbb|lxb|ikc|eja|ekc|efw|dla|du|ctb|cx|xea|cca|cna|cea|ceb|bfa|tta|uh|zl|ze|tlb|hka|bba|kda|dia|kga|sfa|fla|tla|hna|ita|kla|klb|nua|qsa|hta|qla|cqa|itb|kqa|tba|gla|ola|joe|nna|kta|nxa|nsa|hwa|ssa|nxb|bbb|tlc|ena|sda|msa|ktc|kdb|tca|cka|kca|mst|olb|bta|eka|bpa|dta|tma|nta|ebb|esa|tcb|eca|enb|nea|ima|nia|mua|kma|kib|kfa)$
RewriteRule ^next/full-face-photos\.asp$ patient-%1.html [R=301,L]
# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
# Make sure .htc files are served with the proper MIME type, which is critical
# for XP SP2. Un-comment if your host allows htaccess MIME type overrides.
#AddType text/x-component .htc
# If your server is not already configured as such, the following directive
# should be uncommented in order to set PHP's register_globals option to OFF.
# This closes a major security hole that is abused by most XSS (cross-site
# scripting) attacks. For more information: http://php.net/register_globals
#
# To verify that this option has been set to OFF, open the Manager and choose
# Reports -> System Info and then click the phpinfo() link. Do a Find on Page
# for "register_globals". The Local Value should be OFF. If the Master Value
# is OFF then you do not need this directive here.
#
# IF REGISTER_GLOBALS DIRECTIVE CAUSES 500 INTERNAL SERVER ERRORS :
#
# Your server does not allow PHP directives to be set via .htaccess. In that
# case you must make this change in your php.ini file instead. If you are
# using a commercial web host, contact the administrators for assistance in
# doing this. Not all servers allow local php.ini files, and they should
# include all PHP configurations (not just this one), or you will effectively
# reset everything to PHP defaults. Consult www.php.net for more detailed
# information about setting PHP directives.
#php_flag register_globals Off
# For servers that support output compression, you should pick up a bit of
# speed by un-commenting the following lines.
#php_flag zlib.output_compression On
#php_value zlib.output_compression_level 5
# The following directives stop screen flicker in IE on CSS rollovers. If
# needed, un-comment the following rules. When they're in place, you may have
# to do a force-refresh in order to see changes in your designs.
#ExpiresActive On
#ExpiresByType image/gif A2592000
#ExpiresByType image/jpeg A2592000
#ExpiresByType image/png A2592000
#BrowserMatch "MSIE" brokenvary=1
#BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
#BrowserMatch "Opera" !brokenvary
#SetEnvIf brokenvary 1 force-no-vary
First, remove the code in red (comment it out). Then, it looks like you can use the pattern of your treatment/fut- URIs to take advantage of regular expressions (by placing those which fail the pattern before the pattern then using RewriteRule ^treatment/fut-([-a-z]+\.asp$ $1.html [R=301,L].
Bookmarks