Forum Moderators: phranque
this is not applicable only for this directory but for all the directories and subdirectories.
How it is possible using htaccess?
[edited by: encyclo at 2:24 am (utc) on Nov. 9, 2007]
[edit reason] switched to example.com [/edit]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*[^/])$ http://www.example.com/$1/ [R=301,L]
But be aware that the directory check invokes a call to the filesystem on your server, and that this results in the CPU running hundreds or thousands of lines of code, and possibly having to go read the disk, for each filesystem check.
Jim
###################################################
# Security #
###################################################
Options +Indexes +FollowSymlinks
<Files "errorpage.html">
Allow from all
</Files>
<Files "errorpage.php">
Allow from all
</Files>
<Files "*.css">
Allow from all
</Files>
<Files "*.gif">
Allow from all
</Files>
<Files "*.jpg">
Allow from all
</Files>
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
###################################################
# Don't allow .ht* files to be browsable #
# Works if AllowOverride Limit is set #
###################################################
<Files ".ht*">
deny from all
</Files>
###################################################
# Overriding php.ini #
# Works if AllowOverride Options is set #
###################################################
#php_flag error_reporting on
#php_flag register_globals on
#php_flag magic_quotes_gpc 0
###################################################
# If Rewrite module is on. #
###################################################
<IfModule mod_rewrite.c>
###################################################
# Turn the RewriteEngine on. #
###################################################
RewriteEngine on
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]
rewriteCond %{HTTP_HOST} .
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.html\ HTTP/
RewriteRule ^(.*)index\.html$ /$1 [R=301,L]
rewriteCond %{HTTP_HOST} .
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*[^/])$ http://www.example.com/$1/ [R=301,L]
###################################################
# Rewrite all .html to .php #
###################################################
RewriteRule ^(.*).html$ $1.php [NC]
RewriteRule ^(.*).xml$ $1.php [NC]
###################################################
# Error trapping and redirecting to custom error page #
###################################################
ErrorDocument 400 /errorpage.html?error_id=400
ErrorDocument 401 errorpage.html?error_id=401
ErrorDocument 403 /errorpage.html?error_id=403
ErrorDocument 404 /errorpage.html?error_id=404
ErrorDocument 405 /errorpage.html?error_id=405
ErrorDocument 408 /errorpage.html?error_id=408
ErrorDocument 415 /errorpage.html?error_id=415
ErrorDocument 500 /errorpage.html?error_id=500
ErrorDocument 501 /errorpage.html?error_id=501
ErrorDocument 502 /errorpage.html?error_id=502
ErrorDocument 503 /errorpage.html?error_id=503
ErrorDocument 505 /errorpage.html?error_id=505
ErrorDocument 504 /errorpage.html?error_id=504
###################################################
# General Rewriting #
###################################################
RewriteRule ^module1/admin/administration/edit-special-style modules/module1/control/editstyle.html [NC]
RewriteRule ^module1/admin/administration modules/module1/control/index.html [NC]
RewriteRule ^module1/google-sitemap modules/module1/google-sitemap-module1.xml [NC]
RewriteRule ^module1/feed modules/module1/rss.xml [NC]
RewriteRule ^module1/archive/(.*)?$ modules/module1/articlearchive.html [NC]
RewriteRule ^module1/(editŠadd) modules/module1/module1_add_edit.html [NC]
RewriteRule ^module1/(.*)\.html modules/module1/module1.html [NC]
RewriteRule ^module1/(.*)?$ modules/module1/index.html [NC]
RewriteRule ^module1(/)?$ modules/module1/ [NC]
</IfModule>