Welcome Guest, Not a member yet? Register   Sign In
? in URLs
#1

[eluser]pgsjoe[/eluser]
I apologize if I missed where this was posted already or if it's in the User Guide, but I seem to have run into a slight problem here. Got my entire company's website up and running using CodeIgniter...it's beautiful. But now, they want me to implement some snippets of code for this Web Form Tracking software (it does more than Google Analytics, so NOT using their service isn't really an option) and the company has come back telling me:

"the snippet of code that we need to have on your site needs to allow for the '?' symbol. However, I noticed when I tested your Web Tracking that your code does not allow for this character. In order for web tracking to work, you’ll need to allow for this character."

Are there any solutions to this problem? I'm still fairly new to CodeIgniter, so I'm not sure how to handle this. Thanks in advance.
#2

[eluser]Armchair Samurai[/eluser]
Check the security section in the user guide.

You can either enable query strings or add '?' to the permitted_uri_chars value in your config file.
#3

[eluser]Colin Williams[/eluser]
You just need to set enable_query_strings to true (and make sure mod_rewrite is not set up in way that effects query strings).

You can't just add ? to the permitted_uri_chars setting because, well you'd also need to add =&% etc., and also CI will empty $_GET.
#4

[eluser]pgsjoe[/eluser]
Any idea how to adjust the Mod Rewrite...this is what I'm using now:

RewriteEngine on
RewriteRule ^$ /index.php [L]
RewriteCond $1 !^(index\.php|beta)
RewriteRule ^(.*)$ /index.php/$1 [L]

Sorry, I'm still way new to this.
#5

[eluser]Colin Williams[/eluser]
Use this:

Code:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1 [L,QSA]

Or even better, and more robust, from the Wiki:

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    #Removes access to the system folder by users.
    #Additionally this will allow you to create a System.php controller,
    #previously this would not have been possible.
    #'system' can be replaced if you have renamed your system folder.
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ index.php/$1 [L]

    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule>
#6

[eluser]pgsjoe[/eluser]
Gonna try and mess around with it a bit more, but got this when I implemented it.

"Firefox has detected that the server is redirecting the request for this address in a way that will never complete."
#7

[eluser]Colin Williams[/eluser]
That means your redirect is not working because index.php is not found in RewriteBase. Make sure index.php is in the RewriteBase (which defaults to the current directory if not provided. I usually leave this out and have .htaccess and index.php on the same directory level).




Theme © iAndrew 2016 - Forum software by © MyBB