CodeIgniter Forums
.htaccess exclude directory - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: .htaccess exclude directory (/showthread.php?tid=55968)



.htaccess exclude directory - El Forum - 11-19-2012

[eluser]LuckyFella73[/eluser]
I made a website for a client and use a htaccess file for cleaner urls.
My problem is: the hosting company provides a link to the phpmyadmin
panel, like

domain.com/_pma_/

Now when calling that url I get a "page not found error" ...

My .htaccess currently looks like this:
Code:
Options -Indexes

AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php43 .php .php4
AddType application/x-httpd-php5 .php5

<IfModule mod_rewrite.c>

DirectoryIndex index.php
RewriteEngine on
RewriteBase /

RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

</IfModule>

Info:
- The directory "_pma" is not visible when connected to the server via ftp.
- I tried to add the directory to the htaccess like this (didn't help):

Code:
RewriteCond $1 !^(index\.php|[b]_pma_[/b]|images|css|js|robots\.txt|favicon\.ico)

I don't know how to exclude this directory from url rewriting so any help is much
appreciated!


.htaccess exclude directory - El Forum - 11-19-2012

[eluser]InsiteFX[/eluser]
Try this LuckyFella73
Code:
RewriteCond %{REQUEST_URI} !^/(domain.com/_pma_/.*)$

may need to remove the first forward slash not sure.

or
Code:
RewriteCond %{REQUEST_URI} !^/_pma_/



.htaccess exclude directory - El Forum - 11-20-2012

[eluser]LuckyFella73[/eluser]
Thanks for your code example. Unfortunatly it didn't work for me.
I tried both with and without leading slash.

Maybe it's because the directory does not exist like the other directories
I have in htdoc? At least it's not visible via ftp connection (I have
my setting switched to "show hidden files").


.htaccess exclude directory - El Forum - 11-20-2012

[eluser]CroNiX[/eluser]
If it's an actual LINK, like a symbolic link in the filesystem, then you can tell the htaccess to ignore those just like you are for the Directories and Files

Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l



.htaccess exclude directory - El Forum - 11-24-2012

[eluser]ahmed.alsiddig[/eluser]
i have the same problem


.htaccess exclude directory - El Forum - 11-24-2012

[eluser]kostyak[/eluser]
Sorry, I have nothing to tell.