Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can !
Moderator: General Moderators
Dale
Forum Contributor
Posts: 466 Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks
Post
by Dale » Sat May 19, 2007 11:12 am
I know nothing is impossible in the world ofprogramming, though I've became stumped on the wonders that are .htaccess files. I have this following piece of code that makes
http://www.someurl.com/something goto
http://www.someurl.com/foo.php?bar=something
Code: Select all
Options +FollowSymLinks
RewriteEngine on
RewriteRule /(.*)$ /foo.php?bar=$1
However doing this makes all myimages (in /images/) disappear, because I suppose they're trying to be located in /foo.php?bar=images/some.jpg (he he) though is there a way that I can get it to not use MOD_REWRITE on the images folder yet still work for everything else?
Last edited by
Dale on Tue May 22, 2007 4:26 am, edited 1 time in total.
Ollie Saunders
DevNet Master
Posts: 3179 Joined: Tue May 24, 2005 6:01 pm
Location: UK
Post
by Ollie Saunders » Sat May 19, 2007 1:11 pm
Something similar to this
Code: Select all
RewriteCond %{REQUEST_URI} !/(names|of|directories|not|to|be|rewritten)/
Dale
Forum Contributor
Posts: 466 Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks
Post
by Dale » Sun May 20, 2007 4:21 am
ole wrote: Something similar to this
Code: Select all
RewriteCond %{REQUEST_URI} !/(names|of|directories|not|to|be|rewritten)/Tried that, but doesn't seem to work. :/
Kieran Huggins
DevNet Master
Posts: 3635 Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:
Post
by Kieran Huggins » Sun May 20, 2007 4:28 am
before, try:
Code: Select all
RewriteRule ^folder_name/.*$ - [PT]
That should match your directory name and abort the rest of the rules.
Ollie Saunders
DevNet Master
Posts: 3179 Joined: Tue May 24, 2005 6:01 pm
Location: UK
Post
by Ollie Saunders » Sun May 20, 2007 5:38 am
Attempt 2:
Code: Select all
RewriteCond %{REQUEST_URI} !/(names|of|directories|not|to|be|rewritten)/.*
thiscatis
Forum Contributor
Posts: 434 Joined: Thu Jul 20, 2006 11:00 am
Post
by thiscatis » Sun May 20, 2007 8:27 am
real life example that use:
Code: Select all
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/shop.* [OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
it excludes a specific folder, a real existing folder or filename.
Dale
Forum Contributor
Posts: 466 Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks
Post
by Dale » Tue May 22, 2007 4:13 am
ole wrote: Attempt 2:
Code: Select all
RewriteCond %{REQUEST_URI} !/(names|of|directories|not|to|be|rewritten)/.*
Always gives me Internal Server Error (500). :/
Ollie Saunders
DevNet Master
Posts: 3179 Joined: Tue May 24, 2005 6:01 pm
Location: UK
Post
by Ollie Saunders » Tue May 22, 2007 4:18 am
Well this works for me
Code: Select all
RewriteEngine On
RewriteCond %{REQUEST_URI} !/(style|gfx|script)/.*
RewriteRule .* bootstrap.php
Dale
Forum Contributor
Posts: 466 Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks
Post
by Dale » Tue May 22, 2007 4:25 am
I checked out
Thread: 67177 and the example in their worked, plus your one did too
ole .
Cheers.