ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Extra question mark in URL

February 16, 2012 3:32pm

Subscribe [3]
  • #1 / Feb 16, 2012 3:32pm

    I’m trying to remove “index.php” from my URLs as described in http://ellislab.com/expressionengine/user-guide/general/remove_index.php.html and am encountering a small hiccup: instead of getting something like:

    http://www.example.com/posts/...

    I’m getting this instead:

    http://www.example.com/?/posts/... (note extra “/?/”)

    Other than the URLs looking weird, everything seems to actually work fine. As far as I can tell, I’ve followed the instructions to the letter. If it matters, I’m using EE on GoDaddy shared hosting and have set “Force URL query strings” to “On.”

    Has anyone seen this before? Am I missing something? Thanks!

    Aaron

  • #2 / Feb 16, 2012 3:40pm

    Ian Young

    200 posts

    ...and have set “Force URL query strings” to “On.”

    That will be your problem. When you set query strings the question mark acts as the separator from the regular URL to the query string. The query string itself is just extra data to be passed to the application. In this case it doesn’t sound like you need to do that.

    Turn that setting off and try again to see if you still get the same problem. You may need to clear caches after the change.

  • #3 / Feb 17, 2012 3:09pm

    The problem with that is that Force Query Strings needs to be on for the site to work at all on GoDaddy, as far as I can tell. If I turn it off, you are right that the question mark goes away, but all I get for pages other than the index page for the site is “No input file specified.”

  • #4 / Feb 17, 2012 3:37pm

    Ian Young

    200 posts

    Some hosts handle things a little differently but try this:

    RewriteRule ^(.*)$ /index.php?/$1 [L]

    (Notice the extra question mark following index.php)

    instead of:

    RewriteRule ^(.*)$ /index.php/$1 [L]

    Does that fix things?

  • #5 / Feb 17, 2012 3:42pm

    I tried that already, but am getting the exact same result. Thanks for the suggestion, though! Aaron

  • #6 / Feb 17, 2012 3:58pm

    Ian Young

    200 posts

    GoDaddy can be a bit of a pain in the backside sometimes. When you’re trying that method do you have Force Query Strings on or off?

    Also, have you checked that you’ve removed index.php from the name of your site’s index page? (Admin > General Config)

  • #7 / Feb 17, 2012 4:05pm

    Unless Force Query Strings is on, I haven’t been able to make the site work at all (other than the index page) no matter what I do, so it’s on. I did remove index.php from the name of the site’s index page. Thanks, Aaron

  • #8 / Feb 17, 2012 6:01pm

    Dan Decker

    7338 posts

    Hi theborderandbeyond,

    The trick is to have “Force Query Strings” off and use the directive Slippy outlined above:

    RewriteRule ^(.*)$ /index.php?/$1 [L]

    With that combination, does everything work properly?

    Cheers,

  • #9 / Feb 22, 2012 1:23pm

    That appears to be working! I must not have tried that exact combination yet, because in every other case when I switched off “Force Query Strings” only the index page of the site would load properly. Thanks so much, Aaron

  • #10 / Feb 24, 2012 2:39pm

    Shane Eckert

    7174 posts

    Hello Aaron,

    I am happy that Dan and Slippy were able to answer your questions and get you working again.

    Thank you for using the ExpressionEngine forums to post your question. If you have any future concerns, you know where to find us!

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases