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

    Need a little bit of help, weve got a database setup with friendly URLS to do the output from the database - this all works fine, however i'm now having to add a physical subdirectory into the structure and basically its breaking and my htaccess skills are nil.

    heres what I have for the virutal database URLS.

    RewriteRule ^resources/([^/]*)/(.+)$ index.php?q=resources/$1-display/&req=$1/$2 [L]

    If i add the physical page to

    domain.com/resources/[document] - all works fine

    if i add it to

    domain.com/resources/subfolder/[document] it explodes.

    ive tried

    RewriteRule ^resources/([^/]*)/(.+)$ index.php?q=resources/subfolder/$1/$2 [L]

    and

    RewriteRule ^resources/subfolder/(.+)$ index.php?q=resources/subfolder/$1/$2 [L]
    RewriteRule ^resources/subfolder/(.+)$ index.php?q=resources/subfolder/$1/ [L]

    But to no avail, anyone got any ideas?

    Thanks

    This question has been answered by Tyreal2012. See the first response.

      • 4172
      • 5,888 Posts
      if this is all inside modx, can't you create a plugin for the system-event OnPageNotFound, which handles the correct forward?
      No need for any rewrite-rules - knowledge then.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 30912
        • 463 Posts
        Need php knowledge for that - and i dont have it wink
        • discuss.answer
          • 30912
          • 463 Posts
          Solved incase anyone else comes accross a similar situation.

          Required an exception to the rule.

          RewriteCond %{REQUEST_URI} !^/resources/infographics
          RewriteRule ^resources/([^/]*)/(.+)$ index.php?q=resources/$1-display/&req=$1/$2 [L]