Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flexibility in .htaccess rules #43

Closed
momon opened this issue Dec 8, 2011 · 1 comment
Closed

Flexibility in .htaccess rules #43

momon opened this issue Dec 8, 2011 · 1 comment

Comments

@momon
Copy link

momon commented Dec 8, 2011

Hello, I've been having some issues with the .htaccess rules imposed by babel when working with other addons and I believe this could be avoided perhaps with more flexible rewrite rules or documentation which contemplate how to work around issues like the one I am having.

In specific I have issues with the Gmaps plugin at: http://modx.com/extras/package/gmaps

Basically the links within the maps are returning 404's because of the rewrite rules currently in place as required by babel. Here are my rewrite rules currently:

# detect language when requesting the root (/)
RewriteCond %{HTTP:Accept-Language} !^(en|es) [NC]
RewriteRule ^$ en/ [R=301,L]
RewriteRule ^$ es/ [R=301,L]

# Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^website\.com [NC]
RewriteRule (.*) http://website.com/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(es|en)/favicon.ico$ favicon.ico [L,QSA]

# redirect all requests to /de/assets* and /nl/assets* to /assets*
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(es|en)/assets(.*)$ assets$2 [L,QSA]

# redirect all other requests to /de/* and /nl/* to index.php and set the cultureKey parameter
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(es|en)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]

coroico from the modx forums was kind enough to help me troubleshoot the issue, he is the author of the gmaps addon. He pointed our the following:

When I write : http://urbeconstrucciones.com/index.php?id=50
I get: http://urbeconstrucciones.com/es/ajaxinfobox.txt which is correct

But when I write : http://urbeconstrucciones.com/index.php?id=50&mkrid=7
I get : http://urbeconstrucciones.com/es/ajaxinfobox.txt which is not correct
I awaited http://urbeconstrucciones.com/es/ajaxinfobox.txt?mkrid=7

I don't know why, but the mkrid parameter is lost when the rules of the htaccess are applied

The sample page I setup to try this out is at:

http://urbeconstrucciones.com/es/proyectos/proyectos-en-planos/torre-vulcana.html

You will see some marked places within the map, when you hover over them, the infobox pops up with the 404 error instead of the correct document as configured.

I appreciate any direction.

Thanks.

@goldsky
Copy link
Collaborator

goldsky commented Nov 27, 2014

Hi, I know that this is an old issue, but I'm cleaning up the tasks.
This issue is much more suitable in MODX's forum.
I'm closing this issue, but if you want to keep the question, please post on forum.

@goldsky goldsky closed this as completed Nov 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants