Page 1 of 1
No direct jump to internal link when using mod_rewrite
Posted: Mon Mar 23, 2009 4:40 pm
by eh
As you all know the relational link at the bottom of the standard templates intented for jumping to the top of the page is defined like this:
In the template, near the top of the page:
Code: Select all
<div id="pagewrapper">
...
<li>{anchor anchor='main' title='Skip to content' accesskey='s' text='Skip to content'}</li>
...
In the template, near the bottomof the page:
Code: Select all
...
{cms_selflink dir="anchor" anchorlink="main" image="design/images/up.gif" label="" text="" title="Top" alt="Top"}
....
Clicking the relational link in a browser quickly moves a page to where the "main" anchor is defined.
But when configuring the CMS to use pretty URL's by changing config.php like this:
Code: Select all
$config['assume_mod_rewrite'] = true; // 'false' by default
$config['use_hierarchy'] = true; // 'false' by default
browsers "somehow" load the page anew from the server and then jump to the internal link's position, thus it takes much longer and consumes bandwidth.
Any idea what the problem is and how to circumvent this behaviour?
Thanks
Ernst
Re: No direct jump to internal link when using mod_rewrite
Posted: Wed Mar 25, 2009 3:17 pm
by Pierre M.
Hello,
are you reporting a performance issue ?
What is your CMSms version ?
What is the hosting context ?
What is your mod_rewrite .htaccess ?
What are all the relevant section of your config.php ?
Pierre M.
Re: No direct jump to internal link when using mod_rewrite
Posted: Sat Apr 04, 2009 6:57 pm
by eh
Hi Pierre
Not really a performance issue - only user experience is bad because it can take several seconds just for jumping to the top of a page.
It's probably best to see my problem "at work".
In the lower bottom right corner of this page you'll notice the up-arrow that links to the #main anchor in the page:
http://www.xinli-training.ch/ferienseminare/fruehling
Click the arrow and see how it behaves.
For comparison look at this CMSMS site. Clicking the correspondig link navigates to the top of the page in a glimpse of an eye:
http://www.3draum.ch/apidoc/
BTW: make sure your browser window is so small that not all content is shown i.e. vertical scrollbars are shown.
---
- CMSMS version is 1.5.2
- Hosting context: shared hosting on Linux with PHP 5.x (php.ini not accessible by myself)
- .htaccess is attached. It's more or less based on a description I found in the CMSMS forum.
- config.php section for pretty URL's is like this:
Code: Select all
#------------
#URL Settings
#------------
#Show mod_rewrite URLs in the menu? You must enable 'use_hierarchy' for this to work for modules
$config['assume_mod_rewrite'] = true;
#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '';
#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism? This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling.
$config['internal_pretty_urls'] = false;
#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy? (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;
#If using none of the above options, what should we be using for the query string
#variable? (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';
Would be very nice if you could figure out what's wrong.
Best regards
Ernst
Re: No direct jump to internal link when using mod_rewrite
Posted: Sat Apr 04, 2009 8:03 pm
by Ted
Looks like the redirect rule to put slashes on the end of everything is getting in the way.
Comment out this bit from your .htaccess and see if it works:
Code: Select all
#RewriteCond %{REQUEST_URI} !/$
#RewriteCond %{REQUEST_URI} !\.
#RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
Re: No direct jump to internal link when using mod_rewrite
Posted: Mon Apr 06, 2009 1:12 pm
by faglork
eh wrote:
For comparison look at this CMSMS site. Clicking the correspondig link navigates to the top of the page in a glimpse of an eye:
http://www.3draum.ch/apidoc/
The code is different. The other site uses a slash between page name and anchor, you don't.
hth,
Alex
Re: No direct jump to internal link when using mod_rewrite
Posted: Wed Apr 08, 2009 2:53 pm
by eh
Hi Alex
Nice to meet you again...
Didn't have time to react to Ted's and your reply yet - will do in the next days and post my feedback here.
Thanks for your support anyway
Ernst