Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

FOP2 Community Forum

  1. Home
  2. Support
  3. Clean URL in a Multi Tenanted Environment using mod rewrite

Clean URL in a Multi Tenanted Environment using mod rewrite

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 68 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I
    I
    IshMalik
    wrote on last edited by
    #1

    Hi

    I have successfully set up fop2 and have got it working in a multi tenanted environment but would like it to work with clean URLs

    each on e of our contexts will be 4 alpha characters so I have this in my virtual host config

    RewriteEngine On
    RewriteRule ^([a-z]{4})$ /?context=$1

    And have tried a lot of permutations of the above.

    I know that mod rewrite is enables because if I put /abc at the end of the user I get an apache error whereas if I put /abcd I get a fop2 login but it's like it ignores the context aspect.

    Does anyone have any ideas about this?

    1 Reply Last reply
    0
    • N
      N
      nicolas
      wrote on last edited by
      #2

      Not sure exactly what your problem might be, I am not an expert with mod_rewrite. I would try to setup some debugging for it to get an idea on what is happening, perhaps this article might help:

      http://www.latenightpc.com/blog/archive ... od_rewrite

      1 Reply Last reply
      0
      • I
        I
        IshMalik
        wrote on last edited by
        #3

        Hi

        Thanks for the tip, it really helped.

        So, the working condition I've got to is:

        RewriteRule ^/([a-z]{4})$ ?context=$1 [L,R]

        The key bit here is the R flag which issues a redirect to the browser and we end up at the messy URL again, which has got me wondering; where exactly is the get variable being picked up? Is it being pulled by php or extracted from the URL string by the javascript?

        1 Reply Last reply
        0
        • N
          N
          nicolas
          wrote on last edited by
          #4

          The variable is picked up from the GET request (it can also be picked up from javascript title attribute). But in your case the get is all that matters. If mod_rewrite is redirecting you and passes the request with the context in it, then it should work just fine. But as I am really not familiar with mod_rewrite and its complexities, I cannot tell you if something is amiss. Not sure if you need to pass /fop2/?context= instead of just context= for example.

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          Powered by NodeBB Contributors
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups