Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

proper htaccess file for HTTPS redirects to a URL with subfolder

Greetings,

I'm running osTicket v1.9.7 (4be5782)  on Apache on a Synology NAS device.   I've been experimenting with ways to make the following work:

http://helpdesk.domain.com and https://helpdesk.domain.com both rewrite to https://helpdesk.domain.com/osticket/upload.

Every time I get that working it breaks account activation and password reset links and gives a 404 error, "page you are looking for cannot be found".  Does anyone know how I can avoid that happening?

My current htaccess file has the following lines:

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/$
RewriteRule (.*) https://helpdesk.domain.com/osticket/upload [R=301,L]

Comments

  • Oh, thanks in advance btw :)
  • 1.9.7 is old.  You should upgrade to current and then test again.
  • Wanting to follow up on this.

    The htaccess file that has worked (mostly) for me looks like this:

    Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{REQUEST_URI} ^/$
    RewriteRule (.*) https://helpdesk.lacheim.org/osticket/upload [R=301,L]

    I may try this other method suggested by a poster on the Synology forum as I'm having some issues with links being incorrect:

    1. On Web Station: create a virtual Host, use a port different than 80,
    443, and point the document root to the absolute path of
    osticket/upload.

    2. On Control Panel + Application Portal: create
    a reverse proxy for http, and another for https, both from the default
    port to the newly created virtual server (can use http, or https, but I
    see no point in wasting resources with the later -- yep, the https proxy
    can/will translate to http).

    https://forum.synology.com/enu/viewtopic.php?f=20&t=117320

    Thanks
    Fred




  • Are you sure you need a redirect (r=301)?  Do you require https?  Take it out and see if it works.

    What page is it hitting, exactly?  Does it show in the URL?  I have had problems with relative links in plugins.

    Did you dump the original .htaccess file?

    These are the rules I use for IIS, so you will have to convert them but I believe these are already on the installation.  I used to use it on Synology before I moved to IIS.



            <rewrite>
                <rules>
                    <rule name="HTTP api" stopProcessing="true">
                        <match url="^(.*/)?api/(.*)$" ignoreCase="true" />
                        <conditions>
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="{R:1}api/http.php/{R:2}" />
                    </rule>
                    <rule name="Site pages" stopProcessing="true">
                        <match url="^(.*/)?pages/(.*)$" ignoreCase="true" />
                        <conditions>
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="{R:1}pages/index.php/{R:2}" />
                    </rule>
                    <rule name="Staff applications" stopProcessing="true">
                        <match url="^(.*/)?scp/apps/(.*)$" ignoreCase="true" />
                        <conditions>
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="{R:1}scp/apps/dispatcher.php/{R:2}" />
                    </rule>
                </rules>
            </rewrite>
  • I need https only to work internally or externally.  No unsecured port 80.

    I wonder is has something to do with my other problem...

    http://osticket.com/forum/discussion/88033/broken-links-in-user-messages#latest

    Thanks,
    Fred
Sign In or Register to comment.