Has anyone set up mod_rewrite

Grab a cup of coffee and talk.

Has anyone set up mod_rewrite

Postby Gordon McLean » Tue Jan 24, 2017 10:44 am

Hi
I am in the process or replacing an existing website with 16 years of Google listings and a great deal of in place SEO. The customer is adamant that the URL structure must remain the same as his existing site and we are looking for solutions. Has anyone had any experience with re directing external URLS to a servoy url for instance

https://www.bigbarn.co.uk/marketplace/

redirected to

http://www.clickdigital.com:8080/bigbar ... f=baseForm

Any tips or suggestions would be very much appreciated. I have an Apache server available and would consider installing NginX if this is easier, I think I need a proxy solution.

Gordon
Gordon McLean
Clickdigital.com
Gordon McLean
 
Posts: 191
Joined: Wed Aug 03, 2005 12:24 pm
Location: UK

Re: Has anyone set up mod_rewrite

Postby goldcougar » Tue Jan 24, 2017 7:41 pm

You can use this: http://tuckey.org/urlrewrite/

urlrewrite-3.2.0.jar goes in: application_server\server\lib

Then adjust the web.xml in application_server\server\webapps\ROOT\WEB-INF
Add this at the top, after <web-app>
Code: Select all
       <filter>
            <filter-name>UrlRewriteFilter</filter-name>
            <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
            <init-param>
                <param-name>logLevel</param-name>
                <param-value>WARN</param-value>
            </init-param>
        </filter>
        <filter-mapping>
            <filter-name>UrlRewriteFilter</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>


Then add your urlrewrite.xml to application_server\server\webapps\ROOT\WEB-INF
It should contain your rewrite rules.

This page has some good examples. http://tuckey.org/urlrewrite/manual/3.0/guide.html
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Free Training Videos
Servoy Guy- Free Plugins, Tips & Resources
ServoyForge- Open Source Servoy Components
User avatar
goldcougar
Servoy Expert
 
Posts: 657
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Re: Has anyone set up mod_rewrite

Postby Gordon McLean » Thu Jan 26, 2017 11:11 am

Brilliant thanks Scott
Gordon McLean
Clickdigital.com
Gordon McLean
 
Posts: 191
Joined: Wed Aug 03, 2005 12:24 pm
Location: UK

Re: Has anyone set up mod_rewrite

Postby juan.cristobo » Fri May 26, 2017 4:37 pm

Does tuckey urlrewrite work in Servoy 8?

I tried to used it, but when I start web client in my developer I receive an "ERR_CONNECTION_REFUSED" error.

I've moved urlrewrite jar from application_server\server\lib to application_server\server\webapps\ROOT\WEB-INF\lib and webclient works, but it doesn' any rewrite.

Regards,
Juan
Madrid (Spain)

Servoy 7.4.x - MySQL / SQL Server 2008-2016
Windows 10 Pro
juan.cristobo
 
Posts: 178
Joined: Thu Apr 19, 2012 9:12 am

Re: Has anyone set up mod_rewrite

Postby maurice1471270175 » Mon May 29, 2017 10:13 am

Hi,

Same here, in svy 6 it all works, migrating to svy 8 it seems to be broke.
Not sure whats happening. And no solution yet.
Maurice Meijer
STB Zorg
maurice1471270175
 
Posts: 2
Joined: Mon Aug 15, 2016 4:09 pm

Re: Has anyone set up mod_rewrite

Postby jcompagner » Mon May 29, 2017 11:57 am

what errors are logged in the various log files (like tomcat,developer or servoy logs)
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 7977
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Has anyone set up mod_rewrite

Postby juan.cristobo » Mon May 29, 2017 12:45 pm

I don't find any error in the logs.

If I put urlrewrite jar outside of application_server\server\webapps\ROOT\WEB-INF\lib directory I receive the "ERR_CONNECTION_REFUSED" error. If I put it in that directory, web client works fine, but it doesn' any rewrite.
Juan
Madrid (Spain)

Servoy 7.4.x - MySQL / SQL Server 2008-2016
Windows 10 Pro
juan.cristobo
 
Posts: 178
Joined: Thu Apr 19, 2012 9:12 am

Re: Has anyone set up mod_rewrite

Postby rgansevles » Fri Jun 23, 2017 11:41 am

Can you give more details on the configuration with which it failed?

I tried a simple setup in 8.1.4 and it worked as expected.
The web-xml was changed exactly as in the docs of this jar, i added the jar to WEB-INF/lib and the urlrewrite-xml is the simplest:
Code: Select all
<urlrewrite>
    <rule>
        <from>/bla</from>
        <to type="redirect">/servoy-webclient/solutions/solution/tst</to>
    </rule>
</urlrewrite>


This worked both in developer and in application server.

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1841
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL


Return to Servoy cafe

Who is online

Users browsing this forum: No registered users and 1 guest

cron