Forum Moderators: phranque
I have the following in my .htaccess:
RewriteEngine on
RewriteRule!(^/forums/.*$¦\.(gif¦css¦jpg¦png¦js¦asf¦avi¦wmv¦swf¦xsl¦jar¦ inc.php))$ /includes/request.inc.php I also have IPB forums in the /forums/ directory. The .htaccess is supposed to redirect all server requests except those inside the /forums/ directory (and except those with the filenames specified).
When I try to go on the forum I am told the following:
Warning: main(./conf_global.php): failed to open stream: No such file or directory in /home/tekp/public_html/forums/index.php on line 107Warning: main(./conf_global.php): failed to open stream: No such file or directory in /home/tekp/public_html/forums/index.php on line 107
Any suggestions? Cheers :D
RewriteEngine on
RewriteRule !(^forums/¦(\.(asf¦avi¦css¦gif¦inc\.php¦jar¦jpg¦js¦png¦swf¦wmv¦xsl)$)) /includes/request.inc.php [L]
Replace all instances of the broken pipe "¦" character with a solid pipe characters before use - posting on this board modifies them.
Jim
You can exclude any URL-path-pattern you like from your rules. Rules can be constructed to specifically rewrite certain requests (inclusive), to rewrite all except certain URLs (exclusive), or a mixture of the two, whichever requires the least code, results in the simplest code, or results in code that is easier to maintain.
Be aware that a server-side include (via SSI or PHP, for example) does not access the included file by using HTTP requests; it simply reads the file using the local server filesystem. For this reason, it will not activate any HTTP-related functions, including .HTaccess or HTTPpd.conf -- Both of these start with "HT" because they relate to HTTP requests only. The local filesystem equivalent of an HTTP URL rewrite for use with server-side includes would be a 'symbolic link' -- See your *nix 'man' page for more info.
For more information on RewriteRule flags like [L], see the documentation cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim