We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29860
    • 59 Posts
    hey all

    I am using evo 1.0.4 and trying to modify the htaccess so that I can take parameters from a friendly url but still go to a specific modx page.

    Here’s a break down of my setup and what I’m trying to do :
    * have an alias of a page called ’company-booking’.
    * If the person comes in on a address such as "company-repair-in-townName" I want to mod rewrite it so that it goes to my prementioned ’company-booking’ page
    * The rewrite should also create a param called "area" which I rewrite to area=townName
    * I then use a snippet to query the $_GET array and display the "townName" in my document
    * I have the following line written in my htaccess :

    RewriteRule ^company-repair-in-(.*)$ index.php?q=company-booking&area=$1 [NC,L,QSA]

    The weird thing is that it works a few times and then it redirects to my error page and loses the styles. I tested index.php?q=company-booking&area=townTest but that seems to work ok (without the above line included). When i re-introduce the rewrite rule above, it loses it styles and thinks its a 404 error

    help?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You might be better off using a plugin to do this.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 29860
        • 59 Posts
        Quote from: sottwell at Aug 09, 2010, 10:45 AM

        You might be better off using a plugin to do this.

        I wouldve thought just modifying the htaccess would be easier?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Well, if you figure it out, please share it with us!
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org