EllisLab text mark
Advanced Search
     
pagination adding index.php
Posted: 29 February 2012 02:55 PM   [ Ignore ]
Joined: 2011-10-24
3 posts

when adding pagination to a listing the url has a prefixed index.php
ie: http://websit.com/newsindex.php/P1

{exp:channel:entries
channel
="news-article"
disable="categories|category_fields|member_data|trackbacks"
require_entry="yes"
dynamic="off"
limit="1"
paginate="bottom"
show_future_entries="yes"
}
 {paginate}
  {if {total_pages} 
1}
  
<div class="pagination">
   <
ul class="pages">
    
{if previous_page}
    
<li class="back">
     <
a href="{auto_path}" title="">&laquo;</a>
    </
li>
    
{/if}
   {pagination_links}
    {page}
     
<li><a href="{pagination_url}" class="page-{pagination_page_number}{if current_page} current{/if}">{pagination_page_number}</a></li>
    
{/page}
   {
/pagination_links}
    {if next_page}
    
<li class="next">
     <
a href="{auto_path}" title="">&raquo;</a>
    </
li>
    
{/if}
   
</ul>
  </
div>
  
{/if}
 {
/paginate}
{
/exp:channel:entries} 

We’re pretty stumped on this.
Any help is greatly appreciated!

 
Posted: 01 March 2012 01:28 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2011-11-25
7174 posts

Hello arrayZero,

I am sorry to hear you are running into a snag here.

I am not sure I understand what the issue is? What are you observing and what are you expecting?

Please let me know and we will go from there.

Cheers,

 Signature 

Recent version: EE 2.5.4 | Forum Module 3.1.10 | MSM 2.1.4 | 2.x Bug Tracker | Version Upgrade

 
Posted: 01 March 2012 04:04 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2011-10-24
3 posts

the problem is simply, our site is set up to exclude index.php from the url
yet when using pagination index.php is being added mid path like so:
http://website.com/newsindex.php/P1

were pretty stumped on this behavior, but worked around it by using Low Replace to yank out ‘index.php’.
It’s a bit hacky but it worked, no sure if there is any other solution.
We have other sites using the same implementation with out the index.php issue so were not sure where this problem came from.

 
Posted: 01 March 2012 04:10 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2011-11-25
7174 posts

Hey arrayZero,

Gotcha. Did you double check your .htaccess file and is index.php still removed from the Control Panel under Admin->General Configuration?

Are the .htaccess files identical between the site that works and the one that does not?

Are the versions of ExpressionEngine the same on both sites?

Please let me know what you find.

Cheers!

 Signature 

Recent version: EE 2.5.4 | Forum Module 3.1.10 | MSM 2.1.4 | 2.x Bug Tracker | Version Upgrade

 
Posted: 02 March 2012 10:10 AM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Joined: 2011-10-24
3 posts

yeah we check our htaccess & our settings, the versions are the same we even moved the site local with mamp and had the same issue.
like i said we do have it working, though not ideally its not super urgent any longer.
not sure where to go from here.

 
Posted: 02 March 2012 08:04 PM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2004-05-13
3805 posts

Hi arrayZero,

I tested your code above on my sandbox install and it works as expected. Could you open up your index.php file and look for this line

// $assign_to_config[‘site_url’] = ‘http://domain2.com’;

uncomment it and fill in the correct value and try again. Let me know if this works for you.

SEan

 Signature 

web: Caffeine Creations twitter @CS_sean

 
Posted: 17 March 2012 01:12 PM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Joined: 2006-12-27
37 posts

Had the same problem here but haven’t got index.php removed.

Found that adding “paginate_base=” parameter fixed it..

 
Posted: 19 March 2012 02:16 PM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Avatar
Joined: 2011-11-25
7174 posts

Hey arrayZero,

Thanks for the tip salmoon.

How are things going for you arrayZero? Any progress?

Cheers,

 Signature 

Recent version: EE 2.5.4 | Forum Module 3.1.10 | MSM 2.1.4 | 2.x Bug Tracker | Version Upgrade

 
Posted: 28 June 2012 08:33 PM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Joined: 2008-07-04
55 posts

I’m having a similar, though somewhat more complex, problem.

I’m also removing index.php using this htaccess file that I’ve used before on other clients’ sites:

RewriteEngine On 
RewriteCond 
$!\.(gif|jpe?g|png)$ [NC]
RewriteCond 
%{REQUEST_FILENAME} !-
RewriteCond 
%{REQUEST_FILENAME} !-
RewriteRule 
^(.*)$ index.php/$1 [L] 

I’ve removed index.php from the general configuration and the site links work fine.

However, like the original poster here, EE is adding index.php to my pagination links:
A pagination link that should read: “domain.com/press/P8” instead reads: “domain.com/pressindex.php/P8”


My case is complicated, I’m afraid, by the fact that I am also trying to manage a multi-language site as described here: http://expressionengine.com/wiki/Multi_language_site_alternative/

I’m not sure if this is part of the problem or incidental. It means that I have two root level folders, /en/ and /fr/, each with a copy of the htaccess file with a lauguage prefix, e.g. for French, the last line reads:

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

As instructed by the multi-language method, I also have a copy of index.php in each language folder, and here, maybe, is a potential source of my problem. These copies of the index.php file are supposed to have these lines uncommented and filled out like so:

$template "";
$site_url "http://www.domain.com/fr/";
$site_index "";
$site_404 "";
$global_vars = array(
    
"country_code" => "fr",
    
"language" => "french"
); // This array must be associative 


But when I tried this, it gave my URLs a redundant domain, i.e. http://www.domain.com/http://www.domain.com/fr/

So I resorted to shortening the site_url to:

$site_url "/fr/"

This works fine for everything except the pagination (if, in fact, it’s actually part of the problem). (I tried replacing the domain as a test, and the added index.php in the pagination URLs remained.)


Interestingly, another instance of pagination that is being produced as part of the third party Solspace Calendar module’s
“calendar:cal” tag is paginating fine with the same standard pagination syntax.

 

 
Posted: 29 June 2012 04:44 PM   [ Ignore ]   [ # 9 ]   [ Rating: 0 ]
Avatar
Joined: 2011-11-25
7174 posts

Hey Charley,

I am sorry to hear you are running into this problem.

You might try checking through the paths in the Control Panel for that index.php in the url. That would makes some sense, especially since the pagination for a module works well.

Please let me know what you find.

Cheers,

 Signature 

Recent version: EE 2.5.4 | Forum Module 3.1.10 | MSM 2.1.4 | 2.x Bug Tracker | Version Upgrade

 
Posted: 29 June 2012 05:55 PM   [ Ignore ]   [ # 10 ]   [ Rating: 0 ]
Joined: 2008-07-04
55 posts

Thanks, Shane. I found it.

In my case it was a misconfiguration of the multi-language index.php files. The original article in the Wiki is apparently wrong and was corrected by a commenter (moonbeetle) in the subsequent discussion. (The original article was never corrected.)
http://ellislab.com/forums/viewthread/89111/

In the changes to the index.php files in the /en/ and /fr/ language folders the line that was changed to read:

$assign_to_config['site_index''http://www.domain.com/fr/'

should instead be:

$assign_to_config['site_index''';
$assign_to_config['site_url''http://www.domain.com/fr/'

 

 
Posted: 02 July 2012 12:02 PM   [ Ignore ]   [ # 11 ]   [ Rating: 0 ]
Avatar
Joined: 2011-11-25
7174 posts

Hey Charley,

DOH! That needs to be updated.

Thanks for pointing that out and I am glad that things are working again!

If you need anything else, please just let me know by opening a new thread.

Cheers,

 Signature 

Recent version: EE 2.5.4 | Forum Module 3.1.10 | MSM 2.1.4 | 2.x Bug Tracker | Version Upgrade