Menu links adds a '?'

Feed 8 posts, 5 voices

Avatar
12 posts

Hi,

I was wondering if I’m doing something wrong here.
I have mod_rewrite enabled and it works.

If i type www.mydomain.com/contact.htm the page shows up perfectly.

I have a little php script which dynamically creates the main menu with the files under the home page hierarchy.

<?php foreach($this->find("/")->children() as \$menu): ?>      
       <li>
          <?php echo $menu->link($menu->title, (in_array($menu->slug, $this->url) ? "class=\"active\"": "class=\"menu\"")); ?>
       </li>
    <?php endforeach; ?>

When I click on a link from the menu, it adds the famous “?”.
Example www.mydomain.com/?contact.html

Is there anything I can do to not have the “?”.

In the admin section I always get the ‘?’… example www.mydomain.com/admin/?/page

I have done this with frog 0.9.3 and it’s okay but with version 0.9.5 I get this problem.

Thank you

 
Avatar
13 posts

Have you changed USE_MOD_REWRITE in the config.php to true? This should fix it.

 
Avatar
12 posts

Yes I have. And added .htaccess file

 
Avatar
12 posts

No one knows why?

 
Avatar
1 posts

I am struggling with this too – if it makes no difference to search engines then it is ok, does anyone happen to know?

Thanks

 
Avatar
1493 posts

If you have followed the instructions (to the letter!) and the question mark is still not removed, then it is worth checking with your host to see if there is an issue with how they handle mod_rewrite and .htaccess files.

 
Avatar
2 posts

I have this problem.

When I change mod_rewrite in config.php to false the ? is there.
When I change mod_rewrite in config.php to true the ? goes from the path but links do not work I get a 404 error.

 
Avatar
1493 posts

@kim – where is Frog installed? if it is in the root directory (e.g., http://www.myfrogsite.com/), then in the .htaccess file, you should have a line like this:

RewriteBase /

If you have it in a subdirectory (e.g. http://www.mysite.com/cms/), then it should look like this:

RewriteBase /cms/

If that doesn’t help, see the bottom of this thread and see if that applies to your situation.

 
Avatar
2 posts

Many thanks to those who replied.

I have resolved this and am posting in case it helps anyone else, I commented out a couple of lines in htaccess, the new version below.

Also – I am not sure if this made any difference but someone told me magic quotes can be tricky on shared hosting so I put a php.ini in every directory with this as the contents:

magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off

This is .htaccess

#
# Setting Frog requirements
#

#php_flag magic_quotes_gpc off
#AddDefaultCharset UTF-8
#Options -Indexes +FollowSymLinks

#
# Setting rewrite rules
#

<IfModule mod_rewrite.c>
  RewriteEngine On
  # Set next line to your Frog root - if not in subdir, then just / 
  RewriteBase /

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-l
  # Administration URL rewriting.
  RewriteRule ^admin(.*)$ admin/index.php?$1 [L,QSA]

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-l
  # Main URL rewriting.
  RewriteRule ^(.*)$ index.php?PAGE=$1 [L,QSA]

</IfModule>