Git Product home page Git Product logo

Comments (8)

haubourg avatar haubourg commented on May 15, 2024

+1 !

from lizmap-web-client.

rldhont avatar rldhont commented on May 15, 2024

@mdouchin already done in 3.2.0 ?

from lizmap-web-client.

rldhont avatar rldhont commented on May 15, 2024

@laurentj can you review it ? How to activate shorter urls in lizmap ?

from lizmap-web-client.

laurentj avatar laurentj commented on May 15, 2024

@Reluc the urls.xml.dist contains some URLs declaration, but this was a work in progress. I have a (very old) branch that contains more fix in order to be able to activate significant url, but i did not finished.

So there are still some work to do. It is definitively for a futur version, not for 3.2, except if you want to delay the release of 3.2

from lizmap-web-client.

rldhont avatar rldhont commented on May 15, 2024

ok move to 3.3

from lizmap-web-client.

ninsbl avatar ninsbl commented on May 15, 2024

Hi,

recently, I had to shorten a Lizmap URL on my installation. It took me a while to figure out how to do that. So, after I got it work I wrote the little documentation below. Maybe it is useful (e.g. for inclusion in the installation/administration guide).

If you would be interested in a PR, let me know where in the documentation you would want such a section (a pointer to gihub repo and file would be nice)...

Shorten Lizmap URLs

Lizmap URLs can be long and cumbersome to use and communicate. Therefore rewriting and simplification of the URLs can be
helpful. During Lizmap installation, mod_rewrite should have been enabled already, so the prerequisites
should be in place.

This is how to go about to shorten Lizmap URLs:

1.) Add the following entry in the VirtualHost section of:
/etc/apache2/sites-available/000-default.conf:

<VirtualHost>
(...)

        <Directory /var/www/html>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Require all granted
        </Directory>

</VirtualHost>

2.) Create a .htaccess file (or edit it if it already exists) with the following entries at /var/www/html:

# Start rewrite engine
RewriteEngine on
# Define rewrite rule(s)
RewriteRule ^MYPROJECT$ lizmap/index.php/view/map/?repository=1&project=MYPROJECT [QSA]

Here, multiple rewrite rules can be specified for multiple Lizmap repositories. A rewrite rule consists of four components, separated by white space:

  1. RewriteRule: The instruction to be processed by apache2
  2. ^MYPROJECT$: the source, the requested URL on the host that is supposed to be mapped to a php query of a given Lizmap repository.
    Here ^ marks the beginning and $ marks the end in the URL a user has to call to open a map from a specific Lizmap repository.
    So, on host www.example.com, requesting the URL www.example.com/MYPROJECT would open Lizmap repository 1 with project MYPROJECT for a lizmap web client installed to /var/www/html/lizmap.
  3. lizmap/index.php/view/map/?repository=1&project=MYPROJECT: the target, the query that is is to be executed when a users calls the simplified URL (e.g. www.example.com/MYPROJECT).
    The query is appended to the base URL of the level where the .htaccess file is stored. Note that you may have installed lizmap to a different subdirectory.
  4. [QSA]: Flags, indicating how the Rewrite rule is supposed to be processed.

For more detailed infromation on URL rewriting, see Apache2 documentation

from lizmap-web-client.

pcav avatar pcav commented on May 15, 2024

I agree, this should go into the docs. In fact, a sample .htaccess should probably be installed with Lizmap, leaving the user only the need to edit the VH.

from lizmap-web-client.

virtusmankind avatar virtusmankind commented on May 15, 2024

Hello everyone.
I'm following the @ninsbl solution but I'm facing some issue: in "lizmap/index.php/view/map/?repository=1&project=MYPROJECT" my "lizmap" folder is a virtual link instead of a folder inside html. Should I take some correction in procedure?

from lizmap-web-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.