1

in one of my sites I had to enable "Force URL query strings" because my hosting provider doesn't have "URL Segment Support" enabled.

I don't have the permissions to change Apache configuration file directly.

To remove index.php I have this .htaccess

AcceptPathInfo On
<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteBase /

   # Removes index.php from ExpressionEngine URLs
   RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
   RewriteCond %{REQUEST_URI} !/system/.* [NC]
   RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

   # Directs all EE web requests through the site index file
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule ^(.*)$ /index.php?/$1 [L]
</IfModule>

Now the pages are something like

www.example.com/?/page

Is there a way to remove the question mark through .htaccess or should I ask to my hosting provider to enable URL Segment Support?

Thanks

  • Can any one find solution for this issue? – tejas178 Feb 27 '15 at 12:50
  • No, I finally asked my hosting provider to enable URL Segment Support. – Elena Mar 2 '15 at 14:12
1

I had a similar issue to this previously. Removing the "?" in the last RewriteRule solved the issue.

Change in your .htaccess file:

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

To:

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

Hope this helps you as much as it did me.

| improve this answer | |
  • I tried. In this way I can view the page www.example.com/?/page but if I try to view the page www.example.com/page I view a blank page with the following error: No input file specified. In the other way I can view both versions of URLs but if I put {path='page'} in my template it returns me the one with the question mark. – Elena Jul 17 '14 at 7:28
  • OK, if you update code$config['uri_protocol'] = 'QUERY_STRING';code in your config.php file, as per [link]ellislab.com/expressionengine/user-guide/urls/… does this help? – Banta Jul 17 '14 at 11:22
  • Nothing changed – Elena Jul 23 '14 at 7:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.