Welcome Guest, Not a member yet? Register   Sign In
Updated to CI 2.1 and now got problems with the anchor function
#1

[eluser]Freewolf[/eluser]
Hey all,

Using the anchor() function in a few spots on my site.
And after updating (finally) from CI 1.7.2 to 2.1 I am getting a ?/ after the base url. (IE http://www.someplace.edu/?/snazzy_link/)

What am I missing the change to the newer CI?

This is happening any that I am using the anchor() function. Did I miss a change in the .htaccess file? I am not using the index.php.

#2

[eluser]CroNiX[/eluser]
what's your htaccess look like?
What's your uri_protocol set to?
#3

[eluser]Abel A.[/eluser]
You have to set query strings to false in your config.
#4

[eluser]Freewolf[/eluser]
The .htaccess looks like

Code:
#When your application folder isn't in the system folder
    #This snippet prevents user access to the application folder
    #Submitted by: Fabdrol
    #Rename 'application' to your applications folder name.
    RewriteCond %{REQUEST_URI} ^application.*
    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]
#Changed from RewriteRule ^(.*)$ index.php?/$1 [L] In order to avoid doubling of redirected URLs

Thanks for any help.
#5

[eluser]Freewolf[/eluser]
Hey Berk,

That would work however, we do in fact need query strings available as well on our site.
Any other options?
#6

[eluser]InsiteFX[/eluser]
You do not need the top stuff, CodeIgniter now has an .htaccess file in the directories.
Code:
#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]
#7

[eluser]Freewolf[/eluser]
Thanks Insite,

That unfortunately did not help with the ?/ after the domain problem with the anchor function.

#8

[eluser]InsiteFX[/eluser]
Did you enable query strings in your ./application/config/config.php ?
#9

[eluser]Freewolf[/eluser]
Yea used that code in the .htaccess file and enabled query strings.
I still get ?/ right after the domain when using the anchor function.
#10

[eluser]CroNiX[/eluser]
Did you try changing the uri_protocol? Try "query_string" and if that doesn't work try the others available.




Theme © iAndrew 2016 - Forum software by © MyBB