'htaccess ignore directory and subdirectories of existing folder
I have the following structure
- .htaccess
- cms
- other_cms
-- xyz
In the .htaccess I have a lot of rewrite rules which I want to ignore for /other_cms.
I added the following on top of my .htaccess
RewriteEngine On
RewriteRule ^other_cms/ - [L]
RewriteRule ^other_cms/test/ - [L]
RewriteRule ^other_cms(/.*)?$ - [L,NC]
RewriteCond %{REQUEST_URI} ^other_cms/(.*)$
RewriteRule ^.*$ - [L]
My goal is that every subdirectory of /other_cms (no matter if it really exists or not) and /other_cms itself is ignored by this .htaccess file in the root.
I also tried to add a condition to every rule:
RewriteCond %{REQUEST_URI} !^other_cms(/.*|)$
When I open /other_cms/test it still calls all rules and the 404 of the /cms is applied.
I have added an .htaccess file to /other_cms including RewriteEngine Off but I suppose this is never read.
What am I doing wrong?
Solution 1:[1]
- there a subtle requirement of
explore(). Column names in GeoDataFrame need to be strings. In your case they numbers zero and one. - rename these columns:
gdf = gdf.rename(columns={c:str(c) for c in gdf.columns})
import geopandas as gpd
from shapely.geometry import Point
import pandas as pd
# simulate dataframe in question, generates a warning, ignore it
world = gpd.read_file(gpd.datasets.get_path("naturalearth_lowres"))
df = world["geometry"].centroid.apply(lambda g: pd.Series(g.coords[0][::-1]))
geometry = [Point(xy) for xy in zip(df[1], df[0])]
gdf = gpd.GeoDataFrame(data=df, geometry=geometry, crs="epsg:4326")
# explore does not like column names that are not strings...
gdf = gdf.rename(columns={c:str(c) for c in gdf.columns})
# print(gdf.head())
# print(gdf.dtypes)
gdf.explore()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Rob Raymond |
