Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

redirecting canonical URLs
(1 viewing) (1) Guest
Support forum for customers who have purchased JoomSEF 3 (Joomla 1.5 compatible). Archive only, no new post can be added.

NOTE: This category has been locked. If you have purchased paid version, please, use our Support Ticket system instead. If you are using free edition, please see the Community Support section.
  • Page:
  • 1

TOPIC: redirecting canonical URLs

redirecting canonical URLs 14 years, 1 month ago #14863

hi!

i'm having difficulties with finding the right way to redirect the non-slash version to the slash-version (example.com/test to example.com/test/). it works for the indexpage but not for the subpages.

i have modified the .htaccess several times but it just won't work. i also cleared the joomla and browser cache but with no success.

here is the htaccess i'm currently using. any help would be much appreciated

##
# @version $Id: htaccess.txt 14401 2010-01-26 14:10:00Z louis $
# @package Joomla
# @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
# @license www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##


#####################################################
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations. It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file. If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's. If they work,
# it has been set by your server administrator and you do not need it set here.
#
#####################################################

## Can be commented out if causes errors, see notes above.
#Options +FollowSymLinks

#
# mod_rewrite in use

RewriteEngine On

########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
## Deny access to extension xml files (uncomment out to activate)
#
#Order allow,deny
#Deny from all
#Satisfy all
#
## End of deny access to extension xml files
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a tag in URL
RewriteCond %{QUERY_STRING} (\|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits

# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root)

# RewriteBase /

########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section
The topic has been locked.

Re:redirecting canonical URLs 14 years, 1 month ago #14883

  • pedu
  • OFFLINE
  • Posts: 177
I think, that the problem with trailing slash was fixed (version 3.5.4). What Joom SEF version do you have? Second way to fix it is, check, if you have allowed "Be tolerant to trailing slash" in Joom SEF configuration (second tab).
If it doesn't help, try describe, what exactly you want to do. I'm not sure, where is the problem. It will be gut, when you'll send me the link to your page.
ARTIO Support Team
The topic has been locked.

Re:redirecting canonical URLs 14 years, 1 month ago #14886

hi!

thanks for your reply. i'm using joom sef 3.5.4.

"Be tolerant to trailing slash" was allowed. now i unchecked the box and entered the url redirects manually under "manage 301 redirects". this is working although it's probably not a perfect solution.

basically the problem is that google is indexing both the url without trailing slash and the version with trailing slash and it creates duplicate content for google. for example there is a page

www.example.com/test
and
www.example.com/test/

in the google index. i want that the .htaccess automatically redirects www.example.com/test to www.example.com/test/

i can send you the url via private message if you like.

best regards
The topic has been locked.

Re:redirecting canonical URLs 14 years, 1 month ago #14889

  • pedu
  • OFFLINE
  • Posts: 177
Yes, now i get it. It could really be a problem. Manually change all URLs is impossible. Easy way to solve this problem is change your .htacces file.

enarion.net/web/apache/htaccess/trailing-slash/

I hope, that this article will help you.
ARTIO Support Team
The topic has been locked.

Re:redirecting canonical URLs 14 years, 1 month ago #14897

thanks for the link. it helps understanding .htaccess modifications better. unfortunately all the changes i have made didn't bring the desired result.

in joom sef jo have integrated the option to redirect from non-www to www and it works perfectly. maybe the issue with adding trailings slashes automatically would be a good thing to implement in the next joom sef version

i would be happy if you could look into my .htaccess and see if there is a way to make the redirect work. like you said - 301 all URLs manually is pretty time-consuming.

best regards
The topic has been locked.

Re:redirecting canonical URLs 14 years, 1 month ago #14907

  • pedu
  • OFFLINE
  • Posts: 177
Hello,

I feel bad about it, that is still not working. But for more help I'll need access to your website (login, password) to change your .htaccess file.

You can send it on: This e-mail address is being protected from spambots. You need JavaScript enabled to view it

Maybe it will be enough, to send me just the .htaccess file.
ARTIO Support Team
The topic has been locked.
  • Page:
  • 1
User Login Empty