You are here: Re: [PHP] need help on .htaccess « PHP « IT news, forums, messages
Re: [PHP] need help on .htaccess

Posted by Greg Donald on 05/05/05 16:05

On 5/5/05, Mathieu Dumoulin <mdumoulin@groupimage.com> wrote:
> We have here at work a simple .htaccess that redirects all requests to
> an index page which works fine so far. I'll show you the code of the
> .htaccess you can use it if you can't to, it works perfectly fine.
>
> AddType application/x-httpd-php .html
> RewriteEngine on
> RewriteBase /
> RewriteRule ^$ - [QSA,L]
> RewriteRule ^.*\.gif$ - [L]
> RewriteRule ^.*\.jpg$ - [L]
> RewriteRule ^.*\.css$ - [L]
> RewriteRule ^.*\.png$ - [L]
> RewriteRule ^.*\.exe$ - [L]
> RewriteRule ^(.*)/$ index.html?virtual_path=$1 [QSA,L]
> RewriteRule ^(.*)$ index.html?virtual_path=$1 [QSA,L]
> RewriteRule ^(.*)/index.html$ index.html?virtual_path=$1 [QSA,L]
>
> The major problem i have with this, is that we have a folder called
> /media and i want everything inside this folder to be [L] left alone.
> Right you can see we managed to do this using different extension but i
> got a dynamic module that allows people to upload/download pretty much
> anything from the media folder, so eventually some files are not of
> correcte extension and i get problems regarding a page that doesn't
> really exist in my engine or i just open the DB connection for nothing
> for instance.
>
> I really suck a Regexp so i was wondering if people could help me find
> the exact regexp that will make everything in the /media dir completly
> [L] appart. I tried several things but doesn't work.


Put an .htaccess file in the media/ directory that says RewriteEngine off.


--
Greg Donald
Zend Certified Engineer
http://destiney.com/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация