Topic: htaccess rewrite (MODx + YAMS)
|

|
| Author |
|
Markieham Newbie

Joined: 13 July 2010
Online Status: Offline Posts: 3
|
| Posted: 13 July 2010 at 7:30am | IP Logged
|
|
|
Hi,
I'm trying to set up a website with MODx and YAMS (a multilingual extra).
It's telling me to use this as the htaccess rewrites:
Code:
# Friendly URLs RewriteEngine On RewriteBase /
# Fix
Apache internal dummy connections from breaking [(site_url)] cache RewriteCond
%{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC] RewriteRule
.* - [F,L]
# Exclude /assets and /manager directories from
rewrite rules RewriteRule ^(manager|assets) - [L]
# Redirect
from mydomain.com/rootname to mydomain.com/rootname/ RewriteRule ^nl$
nl/ [R=301,L]
# The Friendly URLs part RewriteCond
%{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule
^nl/(.*)$ index.php?q=$1 [L,QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond
%{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] |
|
|
I've tried to find tutorials to writing httpd.ini rewrites, but I couldn't find something to help me and pretty much everything I do results in 500 server errors :s
Any help greatly appreciated!
Thanks,
Mark
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10489
|
| Posted: 13 July 2010 at 8:26am | IP Logged
|
|
|
So you need the above config in v2 syntax. Here it is:
[ISAPI_Rewrite]
# Exclude /assets and /manager directories from rewrite rules
RewriteRule /(?:manager|assets).* - [I,L]
# Redirect from mydomain.com/rootname to mydomain.com/rootname/
RewriteRule /nl http://www.mydomain.com/nl/ [I,RP]
# The Friendly URLs part
RewriteRule /nl/(?!(?:all|physical|files|and|folders))(.*) /index.php\?q=$1 [I,L]
RewriteRule /(?!(?:all|physical|files|and|folders))(.*) /index.php\?q=$1 [I,L]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
Markieham Newbie

Joined: 13 July 2010
Online Status: Offline Posts: 3
|
| Posted: 13 July 2010 at 8:33am | IP Logged
|
|
|
That's giving me a 404 error when accessing site.com/manager/(index.php?a=17)
The rest of the pages seem to function properly
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10489
|
| Posted: 13 July 2010 at 9:02am | IP Logged
|
|
|
Sorry, please fix this line like this:
RewriteRule /(?:manager|assets).* $0 [I,L]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
Markieham Newbie

Joined: 13 July 2010
Online Status: Offline Posts: 3
|
| Posted: 13 July 2010 at 1:26pm | IP Logged
|
|
|
Thanks.

|
| Back to Top |
|
| |
|
|
If you wish to post a reply to this topic you must first login
If you are not already registered you must first register
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum
|