Clean URLs

Please post answers on the most frequently asked questions about CMSimple
tanavots
Posts: 69
Joined: Sat Feb 25, 2012 4:18 pm

Re: Clean URLs

Post by tanavots » Mon Apr 14, 2014 1:08 pm

cmb wrote: You can try the following .htaccess instead (not sure if that'll work):

Code: Select all

RewriteEngine on

# set the rewrite base to the user directory
RewriteBase /~name/

# Do not rewrite requests to existing directories and files:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Everything else is a CMSimple_XH page request,
# so shift the subfolders to the beginning of the query string
RewriteRule ^([A-z]{2}/)?(.*)$ $1?$2 [QSA]
Unfortunately not.

cmb
Posts: 13273
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Clean URLs

Post by cmb » Mon Apr 14, 2014 2:00 pm

I've set up a user dir enviroment and the original .htaccess as well the modified one (with the proper RewriteBase) worked for me. :?

It might be best to ask your server admin(s); the .htaccess should be enough info for them to figure out the solution.
Christoph M. Becker – Plugins for CMSimple_XH

tanavots
Posts: 69
Joined: Sat Feb 25, 2012 4:18 pm

Re: Clean URLs

Post by tanavots » Tue Apr 15, 2014 10:26 am

cmb wrote:I've set up a user dir enviroment and the original .htaccess as well the modified one (with the proper RewriteBase) worked for me. :?

It might be best to ask your server admin(s); the .htaccess should be enough info for them to figure out the solution.
Sorry, my bad... Figured out, what was wrong. As this was test site in subfolder I forgot to add folder name

Code: Select all

RewriteBase /~name/testsite/

cmb
Posts: 13273
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Clean URLs

Post by cmb » Tue Apr 15, 2014 10:59 am

tanavots wrote:As this was test site in subfolder I forgot to add folder name
Thanks for the feedback. Good to know that there's a solution regarding user directories.
Christoph M. Becker – Plugins for CMSimple_XH

Maxim
Posts: 121
Joined: Thu Jun 13, 2013 6:52 am
Location: Запорожье
Contact:

THANK YOU!!!

Post by Maxim » Tue Apr 29, 2014 11:46 am

cmb wrote:Find function XH_printUrl() in cmsimple/tplfuncs.php and replace it with the following:...
THANK YOU!!!
Simple Hosting
Бедная, бросаемая бурею, безутешная!

Maxim
Posts: 121
Joined: Thu Jun 13, 2013 6:52 am
Location: Запорожье
Contact:

Не загружаются изображения

Post by Maxim » Mon May 26, 2014 4:32 am

[ external image ] Здравствуйте. Не загружаются изображения.
[ external image ] Guten Tag. Nicht die Bilder werden geladen.
[ external image ] Hello. Do not load images.
Simple Hosting
Бедная, бросаемая бурею, безутешная!

tanavots
Posts: 69
Joined: Sat Feb 25, 2012 4:18 pm

Re: Clean URLs

Post by tanavots » Fri May 30, 2014 5:32 am

cmb wrote: Toggling between edit and view mode in the back-end
Switching to view mode in the back-end will change to the "non clean" URLs. That's no problem, but you can change this behavior easily. Find function XH_adminMenu() in cmsimple/adminfuncs.php and replace the following line:

Code: Select all

            'url' => '?' . $su . '&' . $changeMode, 
with:

Code: Select all

            'url' => $su . '&' . $changeMode, 
I noticed, that line is changed in 1.6.2. Instead of & is &. Is there more changes that may affect CleanURL?

cmb
Posts: 13273
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Clean URLs

Post by cmb » Fri May 30, 2014 11:06 am

Maxim wrote:Не загружаются изображения.
I have replied some days ago via PM.
tanavots wrote:I noticed, that line is changed in 1.6.2. Instead of & is &.
Indeed. That was done to allow for a cleaner XH_registerPluginMenuItem() API (actually, URLs use & to separate parameters; & is only needed when the URL is written to (X)HTML, so it's cleaner to escape the URLs late).
tanavots wrote:Is there more changes that may affect CleanURL?
Frankly, I don't know. I have checked my clean URL recipe, and this is the only place where something has changed (I have edited the post accordingly).

To stay on top of things regarding clean URLs, I deem it necessary to make them available in the core. I hope my proposal will be accepted for CMSimple_XH 1.7.
Christoph M. Becker – Plugins for CMSimple_XH

Maxim
Posts: 121
Joined: Thu Jun 13, 2013 6:52 am
Location: Запорожье
Contact:

Thank you.

Post by Maxim » Thu Jun 05, 2014 6:18 am

[ external image ] Исправил:
[ external image ] Korrigiert:
[ external image ] Corrected:
plugins/filebrowser/classes/Filebrowser_View.php
plugins/filebrowser/tpl/cmsbrowser.php

Thank you.
Simple Hosting
Бедная, бросаемая бурею, безутешная!

Maxim
Posts: 121
Joined: Thu Jun 13, 2013 6:52 am
Location: Запорожье
Contact:

URLs без www (.htaccess)

Post by Maxim » Fri Jun 06, 2014 4:50 am

[ external image ] Доброе утро. Предлагаю изменения в файле .htaccess. URLs без www.
[ external image ] Guten morgen. Schlage vor, änderungen in der .htaccess-Datei. URLs ohne www.
[ external image ] Good morning. Proposes changes to the .htaccess file. URLs without www.

Code: Select all

RewriteEngine on

# URLs without www
RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
RewriteRule ^(.*) http://%1/$1 [L,R=301]

# Do not rewrite requests to existing directories and files:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Everything else is a CMSimple_XH page request,
# so shift the subfolders to the beginning of the query string
RewriteRule ^([A-z]{2}/)?([^.]*)(.html)?$ $1?$2 [QSA]
Simple Hosting
Бедная, бросаемая бурею, безутешная!

Post Reply