Forums / Cotonti / General / Handy Urleditor

12>>>

Hello, like putting in so handy pluging urleditor

elfrenazo
#1 2012-06-24 21:54

Hello, like putting in so handy pluging urleditor. Do I have to create new rules?

Twiebie
#2 2012-06-24 23:40

I think these rules will work with the Handy preset:

# Rewrite engine options
RewriteEngine On

# Server-relative path to Cotonti. Replace it with your path if you run Cotonti
# in a subfolder
RewriteBase "/"

# Language selector
#RewriteRule ^(en|ru|de|nl)/(.*) $2?l=$1 [QSA,NC,NE]

# Admin area and message are special scripts
RewriteRule ^admin/([a-z0-9]+) admin.php?m=$1 [QSA,NC,NE,L]
RewriteRule ^(admin|login|message)(/|\?|$) $1.php [QSA,NC,NE,L]

# All the rest goes through standard rewrite gateway
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]+) index.php?rwr=$1 [QSA,NC,NE,L]

Paste them in your .htaccess file.

elfrenazo
#3 2012-06-25 01:12

thank you very much, it works. Failure administration panel. example enter malditopc.es/admin/extensions redirects me to start administration. I can do to fix it?

Trustmaster
#4 2012-06-25 05:38

Are there any other rules in your .htaccess, apart from what Twiebie mentioned?

May the Source be with you!
elfrenazo
#5 2012-06-25 05:52

I tried with nothing, it is strange. Any way to disable the admin rewrite?

Trustmaster
#6 2012-06-25 07:14

Maybe this version can help:

# Rewrite engine options
Options -Indexes
RewriteEngine On

# Server-relative path to Cotonti. Replace it with your path if you run Cotonti
# in a subfolder
RewriteBase "/"

# Admin area and message are special scripts
RewriteRule ^admin/([a-z0-9]+) admin.php?m=$1 [QSA,NC,NE,L]
RewriteRule ^(admin|login|message)(/|\?|$) $1.php [QSA,NC,NE,L]

# System category has priority over /system folder
RewriteRule ^system/?$  index.php?rwr=system [QSA,NC,NE,L]

# All the rest goes through standard rewrite gateway
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]+) index.php?rwr=$1 [QSA,NC,NE,L]
May the Source be with you!
elfrenazo
#7 2012-06-25 17:35

It all works well. thank you very much Twiebie and Trustmaster yes

fraze
#8 2012-06-25 17:58

sorry for hijacking.  i've enabled Handy URLs and added that info to my htaccess but admin still wont work.  i get the same problem elfrenazo did...

Trustmaster
#9 2012-06-25 20:10

It seems that on some hosts you need

Options -Indexes

and on some hosts you don't.

May the Source be with you!
elfrenazo
#10 2012-06-25 20:29


My .htaccess hope that helps.


### COTONTI URLTRANS ###
# Rewrite engine options
Options FollowSymLinks -Indexes
RewriteEngine On

# Server-relative path to Cotonti:
RewriteBase "/"
RewriteRule ^(datas|images|js|themes)/(.*)$ $1/$2 [QSA,NC,NE,L]

# Admin area and message are special scripts
RewriteRule ^admin/([a-z0-9]+) admin.php?m=$1 [QSA,NC,NE,L]
RewriteRule ^(admin|login|message)(/|\?|$) $1.php [QSA,NC,NE,L]

# System category has priority over /system folder
RewriteRule ^system/?$ index.php?rwr=system [QSA,NC,NE,L]

# All the rest goes through standard rewrite gateway
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]+) index.php?rwr=$1 [QSA,NC,NE,L]

### COTONTI URLTRANS ###

fraze
#11 2012-06-25 21:33

perfect - cheers elf :)

Macik
#12 2012-06-26 22:22

Sorry for intervention...

How I can generate with «cot_url» propper link for call ajax part of a plugin ? (I mean «plug.php?r=plugname» or something like this).

https://github.com/macik
правильный хостинг — https://goo.gl/fjCa1F
Trustmaster
#13 2012-06-27 06:38

There are no handy rules for AJAX links, so currently they are raw like: cot_url('plug', 'r=plugname') => index.php?r=plugname.

May the Source be with you!
Macik
#14 2012-07-03 09:33

Another one question:

My plugin uses complicated url like:  lang/plugname/subcat/type/product/params/mode/

I can use Hooks=urleditor.rewrite.first to handle it and transform to actual parameters. But is there any way to compose url with my rules like cot_url does (by hook or else)?

I can write own plug_url function, but it's not convinient to pay attention where to use cot_url and where plug_url.

https://github.com/macik
правильный хостинг — https://goo.gl/fjCa1F
Trustmaster
#15 2012-07-03 18:41

The only way currently available is defining your own cot_url_custom() function. Better solution proposals are welcome.

May the Source be with you!

12>>>