Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Zeus server URL rewriting

Options
  • 22-10-2013 1:46pm
    #1
    Registered Users Posts: 103 ✭✭


    Hi, I'm stumped. Register365 use a Zeus server instead of Apache like everyone else. I need to rewrite the URLs so that .php isn't required or visible in the address bar. On Apache with .htaccess that's pretty straight forward and well documented. For Zeus? Not so much.

    I know it has to be done in a file called rewrite.script but that's as far as I've gotten. Register365 when contacted only give a link to a page which includes unuseful samples and a 404 to a user guide.

    Does anyone have any ideas how to do it? I haven't a clue, any help greatly appreciated.

    (Link http://www.register365.com/knowledge/hosting/support_centre/linux_hosting/528-zeus_rewrite_rules_user_guide.html )


Comments

  • Moderators, Society & Culture Moderators Posts: 17,642 Mod ✭✭✭✭Graham


    Hasn't development in Zeus been discontinued for some time now?

    Talk to your host, see if they can move you to a relevant platform (or move host).


  • Registered Users Posts: 103 ✭✭^pt^


    Graham wrote: »
    Hasn't development in Zeus been discontinued for some time now?

    Talk to your host, see if they can move you to a relevant platform (or move host).

    As far as I know they only use Zeus and there's no alternative. Sadly I don't have time to move host before this becomes an issue; they printed advertising material for an event with the short URLs.


  • Moderators, Society & Culture Moderators Posts: 17,642 Mod ✭✭✭✭Graham


    As soon as the event is done, I'd still recommend you move.

    In the mean time this may help:
    # get the document root
    map path into SCRATCH:DOCROOT from /
    # initialize our variables
    set SCRATCH:ORIG_URL = %{URL}
    set SCRATCH:REQUEST_URI = %{URL}
    
    match URL into $ with ^(.*)\?(.*)$
    if matched then
      set SCRATCH:REQUEST_URI = $1
      set SCRATCH:QUERY_STRING = $2
    endif
    
    # prepare to search for file, rewrite if its not found
    set SCRATCH:REQUEST_FILENAME = %{SCRATCH:DOCROOT}
    set SCRATCH:REQUEST_FILENAME . %{SCRATCH:REQUEST_URI}
    
    # check to see if the file requested is an actual file or
    # a directory with possibly an index.  don't rewrite if so
    look for file at %{SCRATCH:REQUEST_FILENAME}
    if not exists then
      look for dir at %{SCRATCH:REQUEST_FILENAME}
      if not exists then
        look for file at  %{SCRATCH:REQUEST_FILENAME}.php
        if exists then
            set URL = %{SCRATCH:REQUEST_URI}.php?%{SCRATCH:QUERY_STRING}
        else
            set URL = /index.php/%{SCRATCH:REQUEST_URI}?%{SCRATCH:QUERY_STRING}
        endif
      endif
    endif
    goto END
    



    http://stackoverflow.com/questions/1759420/hide-page-extensions-like-stackoverflow


  • Registered Users Posts: 103 ✭✭^pt^


    Lifesaver! Thank you so much, works perfectly.


Advertisement