Welcome Guest, Not a member yet? Register   Sign In
URGENT: Problem with ? in url's
#1

[eluser]Bramme[/eluser]
Okay, I'm in trouble and I need a solution fast.

I have just uploaded the new mickm.com website (if anybody knows it), anyhow it's built on CI, everything (sorta) works and I'm pretty proud of it.

This site also has a phpbb3 forum that just sits in a subdirectory. Now phpbb3 uses query strings with index.php?blahblah and what not. Now those don't work.

I've tried setting enable_query_strings but that didn't work...

I'm guessing it has something to do with my htaccess file, which looks like this:

Code:
Options -Indexes
Options +FollowSymLinks

DirectoryIndex index.php
<IfModule mod_rewrite.c>
    RewriteEngine on

    RewriteCond %{REQUEST_FILENAME} !index.php
    RewriteRule (.*)\.php$ index.php/$1
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]
    
</IfModule>
<IfModule !mod_rewrite.c>
    ErrorDocument 404 index.php
</IfModule>

Is there any way to completely exclude the /forum/ directory from the url rewriting? If yes, please provide me with a concrete piece of code. Thanks in advance!

This is rather urgent as there's a bunch of people looking at me to correct this mistake. Thanks in advance for helping me out!
#2

[eluser]Ciaro[/eluser]
You forgot the RewriteBase.

http://httpd.apache.org/docs/1.3/mod/mod...ewriteBase
#3

[eluser]Bramme[/eluser]
so what should I add and where? okay wait, i'm not that stupid. I think I know where to add it. I'm assuming I need to add a complete server path? Or will a '/' suffice (seeing as it's only the root...)
#4

[eluser]missionsix[/eluser]
Add any subfolders you don't want included onto the RewriteCond line. separate items with a Bar |, escape everything else

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|js|css|forums)
RewriteRule ^(.*)$ index.php/$1 [L,QSA]



PS

I remember MickM. Actually we used to exchange links, but it looks like you've abandoned my link since you switched versions.

Links Page
#5

[eluser]Bramme[/eluser]
[quote author="missionsix" date="1218595773"]Add any subfolders you don't want included onto the RewriteCond line. separate items with a Bar |, escape everything else

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|js|css|forums)
RewriteRule ^(.*)$ index.php/$1 [L,QSA]



PS

I remember MickM. Actually we used to exchange links, but it looks like you've abandoned my link since you switched versions.

Links Page[/quote]

I love you :p

changed to
Code:
Options -Indexes
Options +FollowSymLinks

DirectoryIndex index.php
<IfModule mod_rewrite.c>
    RewriteEngine on
    
    RewriteCond $1 !^(index\.php|forum)

    RewriteCond %{REQUEST_FILENAME} !index.php
    RewriteRule (.*)\.php$ index.php/$1
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]
    
</IfModule>
<IfModule !mod_rewrite.c>
    ErrorDocument 404 index.php
</IfModule>
and it works like a dream!
#6

[eluser]missionsix[/eluser]
awesome!

looks like your tutorial images are broken too:

http://mickm.com/tutorial/192-keep-the-chains

http://mickm.com/tutorial/images/tutorials/chain/1.gif
#7

[eluser]Bramme[/eluser]
Yeah I know, those are fixed now.
#8

[eluser]Bramme[/eluser]
Bumping this topic back up. I had to add two more directories with plain old .html files in to this rule "RewriteCond $1 !^(index\.php|forum)", however, when I added them, I still got 404's. Having the uri point to folder/index.html however works.

Can I prevent this behavior?
#9

[eluser]fesweb[/eluser]
I have no idea if this will help in your case, but it helped in my particular situation. I had to enable query strings for one unavoidable, non-CI task, but then completely ignore the query string itself.

Enable query strings in the config/config.php
Code:
$config['enable_query_strings'] = TRUE;

The usual rewrite stuff, but WITHOUT the Query String Append (QSA) bit in the .htaccess
Code:
// do this
RewriteRule ^(.*)$ /index.php/$1 [L]
// instead of this
RewriteRule ^(.*)$ /index.php/$1 [QSA, L]




Theme © iAndrew 2016 - Forum software by © MyBB