phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
Execute for all EXCEPT certain folder

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » Apache mod Rewrite
::  
Author Message
rotwyla98



Joined: 16 Feb 2007
Posts: 6

Execute for all EXCEPT certain folderPosted: Sun Nov 25, 2007 12:28 am    Post subject: Execute for all EXCEPT certain folder

my current .htaccess code is

Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]
RewriteRule ([^/\.]+)/$ script.php?a=$1 [L]


This basically masks
domain.com/script.php?a=anything-they-type
to
domain.com/anything-they-type/

Currently, I have a folder at domain.com/foldexists/ but when I try to go there, the htaccess rule comes to play and instead of viewing the contents of that folder, I see domain.com/script.php?a=foldexists

How can i make it so that that condition doesnt apply to foldexists?
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

Execute for all EXCEPT certain folderPosted: Sun Nov 25, 2007 3:00 pm    Post subject: Re: Execute for all EXCEPT certain folder

You could just make sure that the directory requested does not exist first :


Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ([^/\.]+)/$ script.php?a=$1 [L]


If the full check : not a file, not a dir and not a link.
Code:
RewriteCond %{REQUEST_FILENAME} !-d


is enough if you only deals with directories.

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
rotwyla98



Joined: 16 Feb 2007
Posts: 6

Execute for all EXCEPT certain folderPosted: Sun Nov 25, 2007 3:12 pm    Post subject: Re: Execute for all EXCEPT certain folder

works like a charm. Thanks
Back to top
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » Apache mod Rewrite
Page 1 of 1

Navigation Similar Topics

Jump to: