Comments (8)
+1 !
from lizmap-web-client.
@mdouchin already done in 3.2.0 ?
from lizmap-web-client.
@laurentj can you review it ? How to activate shorter urls in lizmap ?
from lizmap-web-client.
@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.
ok move to 3.3
from lizmap-web-client.
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:
RewriteRule
: The instruction to be processed by apache2^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 hostwww.example.com
, requesting the URLwww.example.com/MYPROJECT
would open Lizmap repository 1 with project MYPROJECT for a lizmap web client installed to/var/www/html/lizmap
.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.[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.
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.
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)
- [Bug]: Can't print anymore HOT 2
- Problem with permission
- [Bug]: Custom Edition screen is not shown HOT 2
- [Bug]: Lizmap 3.7 doesn't show QGIS Drag&Drop Form as pop up source HOT 3
- [Bug]: Pop up is not shown in atlas container with Lizmap 3.7 HOT 1
- Problem with Lizmap-QGIS_server installation/configuration HOT 4
- [Bug]: Problems using XYZ tiles depending on project reference system in Lizmap 3.7 HOT 2
- [Bug]: Editing fails with no feedback when trying to open a form for a invalid layer HOT 1
- 3.8.0-alpha.1: Measuring does not work. Extension request Snapping HOT 1
- Search by address bar on my lizmap map HOT 9
- Error with "form filter" tool on a GeoPackage HOT 2
- [Bug]: selection tool - circle not present in toolbar
- Different speed of the various Lizmap versions HOT 9
- Layer group not automatically active despite corresponding setting (group as Layer) HOT 1
- SMTP with MS ExchangeServer HOT 1
- [Question]: delete geom nodes in mobile mode
- [Bug]: data - table, virtual field with expression to show small image preview HOT 18
- Append symbol in the legend if the layer is invalid HOT 3
- [Bug]: plot should not display loading gif when there is no data
- [Bug]: popup relation - div popup_lizmap_dd_relation empty in parent
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lizmap-web-client.