SitePoint Sponsor

User Tag List

Results 1 to 25 of 25

Thread: .htaccess - 301 redirect with variables

  1. #1
    SitePoint Guru ripcurlksm's Avatar
    Join Date
    Aug 2004
    Location
    San Clemente, CA
    Posts
    850
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    .htaccess - 301 redirect with variables

    Hello, How can I do a mod rewrite so I can redirect old urls with variables to new pages. For example here is the code that is not working with variables in them. Here you can see the variable "id" in the url and trying to redirect to new pages. Any ideas?

    Code:
    RewriteRule ^gallery/full-face-photos.asp?id=AJ$ new-page1.html [R=301,L]
    RewriteRule ^hairline/hairline-photos.asp?id=GG$ other-hairline2.html [R=301,L]

  2. #2
    Do. Or do not. There is no try silver trophy
    SitePoint Award Recipient ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    8,341
    Mentioned
    86 Post(s)
    Tagged
    2 Thread(s)
    The ?id=AJ part is known as the query string and you can't match for that in a RewriteRule. However, you can match it in a RewriteCond -- which is basically an extra condition for the RewriteRule to fire.
    Also, you need to escape the dot in .asp, otherwise it reads "any character, followed by 'asp'", so it would also match URLs like hairline-photoszasp

    Try this:
    Code:
    RewriteCond %{QUERY_STRING} ^id=AJ$ [NC]
    RewriteRule ^gallery/full-face-photos\.asp$ new-page1.html [R=301,L]
    I'll let you figure the second one out for yourself, shouldn't be too hard
    Rémon - Hosting Advisor

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  3. #3
    SitePoint Guru ripcurlksm's Avatar
    Join Date
    Aug 2004
    Location
    San Clemente, CA
    Posts
    850
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nailed it, thank you!

  4. #4
    SitePoint Guru ripcurlksm's Avatar
    Join Date
    Aug 2004
    Location
    San Clemente, CA
    Posts
    850
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm, The first redirect in the file works, however the other variables are not.. did I miss something?

    Code:
    RewriteCond %{QUERY_STRING} ^id=aa$ [NC]
    RewriteRule ^next/full-face-photos\.asp$ patient-aa.html [R=301,L]
    
    RewriteCond %{QUERY_STRING} ^id=ao$ [NC]
    RewriteRule ^next/full-face-photos\.asp?id=ao$ patient-ao.html [R=301,L]
    
    RewriteCond %{QUERY_STRING} ^id=az$ [NC]
    RewriteRule ^next/full-face-photos\.asp?id=az$ patient-az.html [R=301,L]
    
    RewriteCond %{QUERY_STRING} ^id=bf$ [NC]
    RewriteRule ^next/full-face-photos\.asp?id=bf$ patient-bf.html [R=301,L]
    
    RewriteCond %{QUERY_STRING} ^id=bi$ [NC]
    RewriteRule ^next/full-face-photos\.asp?id=bi$ patient-bi.html [R=301,L]

  5. #5
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,314
    Mentioned
    15 Post(s)
    Tagged
    2 Thread(s)
    RC,

    If the ?id=yadda-yadda is a query string and can never be matched in a RewriteRule, why would you remove it from the first one and leave it in the rest?

    Quote Originally Posted by ripcurlksm View Post
    Hmm, The first redirect in the file works, however the other variables are not.. did I miss something?

    Code:
    RewriteCond %{QUERY_STRING} ^id=aa$ [NC]
    RewriteRule ^next/full-face-photos\.asp$ patient-aa.html [R=301,L]
    
    RewriteCond %{QUERY_STRING} ^id=ao$ [NC]
    RewriteRule ^next/full-face-photos\.asp?id=ao$ patient-ao.html [R=301,L]
    
    RewriteCond %{QUERY_STRING} ^id=az$ [NC]
    RewriteRule ^next/full-face-photos\.asp?id=az$ patient-az.html [R=301,L]
    
    RewriteCond %{QUERY_STRING} ^id=bf$ [NC]
    RewriteRule ^next/full-face-photos\.asp?id=bf$ patient-bf.html [R=301,L]
    
    RewriteCond %{QUERY_STRING} ^id=bi$ [NC]
    RewriteRule ^next/full-face-photos\.asp?id=bi$ patient-bi.html [R=301,L]
    Then, too, specificity is important (and you did not properly define your requirements for your redirection) as you have a pattern you can take advantage of.

    If you can handle ANY two letter pair as the value for your id key, you can use:
    Code:
    RewriteEngine on
    RewriteCond %{QUERY_STRING} ^id=([a-z]{2})$
    RewriteRule ^next/full-face-photos\.asp$ patient-%1.html [R=301,L]
    If not, create a list in the atom thusly:
    Code:
    RewriteEngine on
    RewriteCond %{QUERY_STRING} ^id=(aa|ao|az|bf|bi)$
    RewriteRule ^next/full-face-photos\.asp$ patient-%1.html [R=301,L]
    IMHO, always look for patterns that you can use the power of regex to simplify your code.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    Updated mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  6. #6
    SitePoint Guru ripcurlksm's Avatar
    Join Date
    Aug 2004
    Location
    San Clemente, CA
    Posts
    850
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks dk, i withheld some of those details to keep the post concise and figured I would be able to muscle through my list once i was able to redirect them one-by-one.

  7. #7
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,314
    Mentioned
    15 Post(s)
    Tagged
    2 Thread(s)
    RC,

    No Worries. If I had looked closely, I would have seen via your example code the first time and commented on the pattern but you've been around enough to be able to put it together now.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    Updated mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  8. #8
    SitePoint Guru ripcurlksm's Avatar
    Join Date
    Aug 2004
    Location
    San Clemente, CA
    Posts
    850
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have one more question.

    I need to redirect the old search page URL to the new one and carry the variable over to the actual redirect page.

    How can I redirect this page with query string
    search/search.asp?zoom_query=search+word

    To this page with query string
    search.html?Q=search+word

    So is this correct to add a new rewrite query string to my .htaccess file to setup a new redirect for the search and search variable:
    Code:
    RewriteCond %{QUERY_STRING} ^zoom_query=(%1})$
    RewriteRule ^search/search.\.asp$ search.html?Q=%1 [R=301,L]

  9. #9
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,314
    Mentioned
    15 Post(s)
    Tagged
    2 Thread(s)
    RC,

    It would have been easier if your key didn't change because the query string would carry over unaffected. Oh, well.

    Your first %1} is inappropriate. You could specify the expected character set or use (.*) to capture (and create %1) and then it would work:
    Code:
    RewriteCond %{QUERY_STRING} ^zoom_query=([-a-zA-Z\+\ ]+)$
    RewriteRule ^search/search.\.asp$ search.html?Q=%1 [R=301,L]
    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    Updated mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  10. #10
    SitePoint Guru ripcurlksm's Avatar
    Join Date
    Aug 2004
    Location
    San Clemente, CA
    Posts
    850
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats not working.... I'm sure Im not being concise enough again. Here is the actual page. The first link is fine in the search results. The following links with search.asp are the ones Im trying to redirect. Click the second search result on this page and you will see its not redirecting

    http://www.newhair.com/search.html?Q=steve+hartman

  11. #11
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,314
    Mentioned
    15 Post(s)
    Tagged
    2 Thread(s)
    RC,

    Aw, the second link is to http://www.newhair.com/search/search.asp%3Fzoom_query%3Dsteve%26zoom_page%3D1%26zoom_per_page%3D10%26zoom_cat%3D-1%26zoom_and%3D0 with the query string %3Fzoom_query%3Dsteve%26zoom_page%3D1%26zoom_per_page%3D10%26zoom_cat%3D-1%26zoom_and%3D0. Why in the world would you escape the query string's marker (?), the ='s and the &'s? That's just plain crazy (and defeats the purpose of the ? to denote the separation of the URI from the query string).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    Updated mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  12. #12
    SitePoint Guru ripcurlksm's Avatar
    Join Date
    Aug 2004
    Location
    San Clemente, CA
    Posts
    850
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dklynn View Post
    RC,

    Aw, the second link is to http://www.newhair.com/search/search...26zoom_and%3D0 with the query string %3Fzoom_query%3Dsteve%26zoom_page%3D1%26zoom_per_page%3D10%26zoom_cat%3D-1%26zoom_and%3D0. Why in the world would you escape the query string's marker (?), the ='s and the &'s? That's just plain crazy (and defeats the purpose of the ? to denote the separation of the URI from the query string).

    Regards,

    DK
    I did not intend to escape any of those characters, I guess that is what google has cached for the older site from the last developer?

    What is my next step to get this to work? I either need to redirect to the new page or tell google search.asp is a dead link so it is no longer indexed.

    Please advise! And I am more of a PHP guy than regex/C+ or w/e is used to make this happen :/

  13. #13
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,314
    Mentioned
    15 Post(s)
    Tagged
    2 Thread(s)
    RC,

    I just ran a test on a website of a client's to test the effect of the encoded ?, = and &. They work as the unencoded query string would work.

    Therefore, the problem with the second (and, presumably, all the following) URI?query_string links is that they contain more than just the zoom_query key that you mentioned above, i.e., zoom_page, zoom_per_page, zoom_cat and zoom_and. What about those keys? Specificity IS important, as you've just discovered!

    If you don't care about the other query string keys, merely remove the $ from the code above. If you do, LEAVE THE QUERY STRING ALONE and change the Q in your new $_GET array to zoom_page and deal with it (and the others) any way you wish. The problem you're having is in requiring a change in the key (and number of key/value pairs to handle), not in the mod_rewrite code.

    If it were me, I would have planned the change from ASP to PHP and left the key/value pairs alone so that the PHP versions would handle any change in the database field names in the query statement.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    Updated mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  14. #14
    SitePoint Guru ripcurlksm's Avatar
    Join Date
    Aug 2004
    Location
    San Clemente, CA
    Posts
    850
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Those other keys are not important and I would like to ignore them.

    Ive updated my code and removed the $ and also am now using "zoom_query" on my new page (even though it shouldn't matter), however its still not redirecting:
    Code:
    RewriteCond %{QUERY_STRING} ^zoom_query=([-a-zA-Z\+\ ]+)
    RewriteRule ^search/search.\.asp$ search.html?zoom_query=%1 [R=301,L]
    And here is the new search page with updated $_GET variable:
    http://www.newhair.com/search.html?z...=steve+hartman

    Did i remove the correct "$"? I've tried it several ways and the redirect is still not working. thanks again for helping me figure this out

  15. #15
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,314
    Mentioned
    15 Post(s)
    Tagged
    2 Thread(s)
    RC,

    The point of using the same key/value pairs is that a redirection leaves the query string unaffected (unless you create a new query string or kill the old one with a ? and nothing following in the redirection). Therefore, delete the RewriteCond statement and remove the ?zoom_query=%1 from the redirection:
    Code:
    RewriteEngine on
    RewriteRule ^search/search.\.asp$ search.html [R=301,L]
    If you're paranoid, add the QSA flag ( [R=301,L] becomes [R=301,L,QSA] ) to ensure that the pre-existing query string is appended. This is NOT necessary in the code immediately above as I've removed the query string you created in the redirection (so the query string is unaffected, i.e., delivered as it existed - you can ignore the superfluous key/value pairs in the search.html and they'll not have any affect).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    Updated mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  16. #16
    SitePoint Guru ripcurlksm's Avatar
    Join Date
    Aug 2004
    Location
    San Clemente, CA
    Posts
    850
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I've updated my code and no luck. Here is my full .htaccess file with your last tag in red and towards the bottom

    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]
    
    
    
    # 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

  17. #17
    Do. Or do not. There is no try silver trophy
    SitePoint Award Recipient ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    8,341
    Mentioned
    86 Post(s)
    Tagged
    2 Thread(s)
    I suppose the old search file was search.asp, in which case the dot in red

    Code:
    RewriteRule ^search/search.\.asp$ search.html [R=301,L]
    is superfluous and breaks the rule (no pun intended lol)
    Rémon - Hosting Advisor

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  18. #18
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,314
    Mentioned
    15 Post(s)
    Tagged
    2 Thread(s)
    RC,

    I keep posting that RewriteBase was created to UNDO a mod_alias redirection (e.g., Redirect) before allowing mod_rewrite to perform its magic. You don't have a Redirect in your .htaccess so your RewriteBase can only muddle your mod_rewrite redirections.

    Second, you have an additional dot character in your search RewriteRule. Remove the first one.

    Of major importance is that your .htaccess is ridiculously long. Be aware that each and every request made to your server requires that the .htaccess be loaded, parsed and each redirection will require at least a second pass through the code. This is tremendously time consuming and is an abuse of the server. If it's your server, that's your choice but I would move all code (which you've tested thoroughly) to your Apache2.conf (httpd.conf) file so it's only read once (when the server starts).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    Updated mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  19. #19
    SitePoint Guru ripcurlksm's Avatar
    Join Date
    Aug 2004
    Location
    San Clemente, CA
    Posts
    850
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dklynn View Post
    Of major importance is that your .htaccess is ridiculously long. Be aware that each and every request made to your server requires that the .htaccess be loaded, parsed and each redirection will require at least a second pass through the code. This is tremendously time consuming and is an abuse of the server. If it's your server, that's your choice but I would move all code (which you've tested thoroughly) to your Apache2.conf (httpd.conf) file so it's only read once (when the server starts).
    Thank you, once I get everything redirecting properly I will append my http.conf file.

    Quote Originally Posted by dklynn View Post
    I keep posting that RewriteBase was created to UNDO a mod_alias redirection (e.g., Redirect) before allowing mod_rewrite to perform its magic. You don't have a Redirect in your .htaccess so your RewriteBase can only muddle your mod_rewrite redirections.
    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 )

    Quote Originally Posted by dklynn View Post
    Second, you have an additional dot character in your search RewriteRule. Remove the first one.
    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.

    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]
    
    
    
    # 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

  20. #20
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,314
    Mentioned
    15 Post(s)
    Tagged
    2 Thread(s)
    RC,

    Quote Originally Posted by ripcurlksm View Post
    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].
    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    Updated mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  21. #21
    SitePoint Guru ripcurlksm's Avatar
    Join Date
    Aug 2004
    Location
    San Clemente, CA
    Posts
    850
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I commented out those two lines and now my 301 redirects are going from

    http://www.newhair.com/treatment/fut-megasessions.asp to http://www.newhair.com/var/www/vhost...asessions.html (its inserting the root path into the url redirect)

    and the search is still unchanged and the second link is still going to http://www.newhair.com/search/search...26zoom_and%3D0

  22. #22
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,314
    Mentioned
    15 Post(s)
    Tagged
    2 Thread(s)
    RC,

    I've seen that sort of thing on my test server and it's meant that Apache needed a restart. That's also worked on member websites when their hosts would restart, too.

    It's possible that your RewriteCond looking at the query string for a match for the key pt is far too long for Apache. I'm not sure what the line length limit is but I'd assume 255 characters, therefore, please chop that into a couple of RewriteCond statement with [OR] flags between them (NOT after the last one as you want to AND with the RewriteRule).

    The other possibility is that there is a redirection to /path/to/file where Apache would first look to the server's root directory then to your DocumentRoot.

    Move the search redirection before all the others (except the domain, of course) and see whether you've got some intervening statement hijacking the search redirection.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    Updated mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  23. #23
    SitePoint Guru ripcurlksm's Avatar
    Join Date
    Aug 2004
    Location
    San Clemente, CA
    Posts
    850
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ripcurlksm View Post
    and the search is still unchanged and the second link is still going to http://www.newhair.com/search/search...26zoom_and%3D0
    Hey David! So it looks like I am down to this last item still. The search.asp page is not redirecting. I've tried removing all the redirects I added and just having this code below to try and redirect and no luck. Any ideas? I've also restarted the server and same result.

    Code:
    RewriteRule ^search/search\.asp$ search.html [R=301,L]
    As a second option, is it possible to have search.asp go to throw a 404 error so google ignores it and removes it from their cache?

  24. #24
    SitePoint Guru ripcurlksm's Avatar
    Join Date
    Aug 2004
    Location
    San Clemente, CA
    Posts
    850
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This thread has evolved a little bit so Ive posted a new thread with just this last issue I am seeing here: http://www.sitepoint.com/forums/show...arch-variables

  25. #25
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,314
    Mentioned
    15 Post(s)
    Tagged
    2 Thread(s)
    rc,

    As a former TL, I'm not sure SitePoint would appreciate splitting the thread, however, I've already answered over there.

    Since there's nothing wrong with your code above, I'll go back and look at the ordering of the uncommented code but I fear that there's something you've not told us, i.e., you're NOT on an Apache server or MODX does something weird (I've not heard anything about it).

    Catch you over there (unless it's merged onto this thread).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    Updated mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •