开发者

allow a dir in .htaccess

开发者 https://www.devze.com 2023-01-29 21:30 出处:网络
i have the following htaccess file for my codeigniter installation. Everything works, except that it blocks my xml files and urllist for google sitemap submission.

i have the following htaccess file for my codeigniter installation. Everything works, except that it blocks my xml files and urllist for google sitemap submission. How would I allow the whole dir /xml or maybe .xml filetype to be added.

I have absolutely no idea how .htaccess files work...

Thanks!

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'applica开发者_StackOverflowtion' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

# If we don't have mod_rewrite installed, all 404's # can be sent to index.php, and everything works as normal. # Submitted by: ElliotHaughin

ErrorDocument 404 /index.php


Below is my .htaccess file. I think the whole key is the RewriteCond (re-write condition). You can simply put the file extensions or folder names that you want to be ignored.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond $1 !^(index\.php|images|css|js|xml|uploads|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ index.php/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

#Set Charset to UTF-8
AddDefaultCharset UTF-8
</IfModule>

<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin

ErrorDocument 404 /index.php
</IfModule>
0

精彩评论

暂无评论...
验证码 换一张
取 消