Welcome Guest, Not a member yet? Register   Sign In
The problem with duplicates of pages
#1

[eluser]Unknown[/eluser]
I wish everyone a good day!

I would be very grateful to help with my problem. I had read existing topics on the forum frandly URLs, but not one gave me the solution. So I will try describe my problem.

Now page of the my site "duplicated", i.e. available in three URLs each. Here is an example with one of the controllers (such controllers about a dozen, pages slightly differently shaped):
"/clients/17"
"/clients/17/"
"/index.php/clients/17"

I need to keep only one URL ("/clients/17") and the remaining URLs redirect to this.

Site settings and server now i have:
CodeIgniter version 2.0.2

Code:
// config.php
$config['index_page'] = '';
$config['uri_protocol'] = 'PATH_INFO';

PATH_INFO is passed correctly and works fine. It is also needed in internal work the site.

Code:
# .htaccess
# OS FreeBSD 8.3 (shared hoster)
# Server Apache 2.0 with mod_rewrite
# PHP Version 5.2.17

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond $1 !^(index\.php|robots\.txt|favicon\.ico|sitemap\.xml|assets|css|js|images)
    RewriteRule ^(.*)$ /index.php/$1 [L,PT]
</IfModule>


I can solve the problem of trailing slash, when I add the following rule:
Code:
# .htaccess
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)/$ $1 [L,R=301]

But it does not work quite the way we would like. Addresses like "/clients/17/" -> "/index.php/clients/17" (which is not fine for me), addresses "/index.php/clients/17/" -> "/index.php/clients/17".

Articles:
http://www.farinspace.com/codeigniter-htaccess-file/
http://taggedzi.com/articles/display/cod...endly-urls
http://www.web-and-development.com/codei...rl-segment
and documentation on the frandly URLs been read by me, but their solutions do not work for me (i had try them all).

I would be very grateful for any help!




Theme © iAndrew 2016 - Forum software by © MyBB