Vous n'êtes pas identifié(e).
13 février 2024 Sortie de Dotclear 2.29
Pages : 1
This is a sample .htaccess containing that enables you to:
1. Use "clean" URLs,
2. disable hotlinking,
3. force HTTPS for admin sessions, and
4. block a few bad bots.
It should work in a configuration where:
1. Dotclear 2 is placed at the root of your virtual server,
2. Dotclear's admin interface is placed in /admin/,
3. the selected URL scan method is QUERY_STRING, and
4. Apache has mod_rewrite enabled.
# mod_rewrite
<IfModule mod_rewrite.c>
# Clean URLs for Dotclear 2
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/admin
RewriteRule (.*) index.php?$1%{QUERY_STRING}
# No hotlinking
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mydotclearblog.eu/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mydotclearblog.eu.*$ [NC]
RewriteRule \.(gif|jpg|jpeg|png|js|css|swf)$ - [F,NC]
# Force HTTPS for admin sessions
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} ^/admin
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</IfModule>
# Bad bots, see http://www.clockwatchers.com/robots_bad.html
SetEnvIfNoCase User-Agent "^EmailSiphon" bad_bot
SetEnvIfNoCase User-Agent "^EmailWolf" bad_bot
SetEnvIfNoCase User-Agent "^ExtractorPro" bad_bot
SetEnvIfNoCase User-Agent "^CherryPicker" bad_bot
SetEnvIfNoCase User-Agent "^NICErsPRO" bad_bot
SetEnvIfNoCase User-Agent "^Teleport" bad_bot
SetEnvIfNoCase User-Agent "^EmailCollector" bad_bot
SetEnvIfNoCase User-Agent "^DNSRight" bad_bot #own addition
<Limit GET POST>
Order Allow,Deny
Allow from all
Deny from env=bad_bot
</Limit>
# Generic
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#Options -Indexes
#php_value register_globals 0
Check this out, and tell me what you think.
Hors ligne
Guess I've made a mistake. Here's version 1.1 of the above:
# mod_rewrite
<IfModule mod_rewrite.c>
# Clean URLs for Dotclear 2
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/admin
RewriteRule (.*) index.php?$1&%{QUERY_STRING}
# No hotlinking
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mydotclearblog.eu/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mydotclearblog.eu.*$ [NC]
RewriteRule \.(gif|jpg|jpeg|png|js|css|swf)$ - [F,NC]
# Force HTTPS for admin sessions
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} ^/admin
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</IfModule>
# Bad bots, see http://www.clockwatchers.com/robots_bad.html
SetEnvIfNoCase User-Agent "^EmailSiphon" bad_bot
SetEnvIfNoCase User-Agent "^EmailWolf" bad_bot
SetEnvIfNoCase User-Agent "^ExtractorPro" bad_bot
SetEnvIfNoCase User-Agent "^CherryPicker" bad_bot
SetEnvIfNoCase User-Agent "^NICErsPRO" bad_bot
SetEnvIfNoCase User-Agent "^Teleport" bad_bot
SetEnvIfNoCase User-Agent "^EmailCollector" bad_bot
SetEnvIfNoCase User-Agent "^DNSRight" bad_bot #own addition
<Limit GET POST>
Order Allow,Deny
Allow from all
Deny from env=bad_bot
</Limit>
# Generic
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#Options -Indexes
#php_value register_globals 0
Hors ligne
Hi Etz Haim, regarding the clean urls, did you modify the dotclear code?
cause i'm still getting the http://domain.com/myblog/index.php?post … o-Dotclear! in my blog's links, but if i put http://domain.com/myblog/post/2009/10/2 … o-Dotclear, it works.
Hors ligne
Same problem was here (and not solved):
http://forum.dotclear.net/viewtopic.php?id=42153
So, base line is if you want to get rid of "index.php", look for another blog software.
Hors ligne
So, base line is if you want to get rid of "index.php", look for another blog software.
Hohoho ! And I suppose that all dotclear blogs who use that kind of basic URL rewriting are pure illusions ? Here is the .htaccess for the site in my profile (and I can show you dozens of similar examples)
Options -MultiViews -Indexes
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteRule ^$ /index.php/ [L]
</IfModule>
URLs are in path_info and oviously in blog's parameters the URL is
http://philippe.dissitou.org/
Dernière modification par Philippe (2011-02-17 16:16:58)
Hors ligne
Hello amalgame,
first of all sorry if my English does not so feel well. The following text was provided with an on-line translator.
You have explained if I have properly understood how one can change with .htaccess on Pretty Url.
I have tried this, unfortunately, it does not function.
With me there comes the following error message: No input file specified.
The Url from the Problem Domain are: http://suchmaschinenoptimierung-blog.tbtip.de
I have put the .htaccess in the root and config.php I have modified according to the following pattern
// If you have PATH_INFO issue, uncomment following lines
if (!isset($_SERVER['ORIG_PATH_INFO'])) {
$_SERVER['ORIG_PATH_INFO'] = 'http://suchmaschinenoptimierung-blog.tbtip.de/';
}
$_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];
I think sometimes this was wrong absolutely.
Could you help me or another to me?
Oh yes, I use Dotclear 2.2.2 and have the following Blog settings
URL of the Blogs:
http://suchmaschinenoptimierung-blog.tbtip.de/
I have also tried out the following:
http://suchmaschinenoptimierung-blog.tb … index.php/
Method Url: path_info
Must be specially activated, actually, modrewrite. I know this from other systems CMS as for example CMSMS
Leider beherrsche ich nicht die englische Sprache, deswegen helfe ich gerne in deutscher Sprache.
Meine Dotclear-Blogs: Weihnachtsblog; Weihnachtsmärkte in Deutschland, Österreich und der Schweiz; CMS-Systeme - Blogsoftware Dotclear und mehr auf Tbtip.de
Hors ligne
Pages : 1
Vous n'êtes pas identifié(e).