The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 23 posts ] 
Author Message
PostPosted: Mon May 23, 2011 3:34 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue May 17, 2011 7:10 pm
Posts: 34
I have Joomla version 1.5.23 and my issue is that I can log onto my site twice if I put in www. and if I take out www. Example: www.google.com or google.com it allows the user to log in each time and for some reason Internet explorer won't let you login using www. it just refreashes the page and doesn't log you in but in the back end under users it shows up as if you are logged in. The log in works just fine in ie if I take out the www. I have tried it on multiple pc's, removed all cookies and it still happens. I am using Yoologin but even with it deleted and using the standard login it still happens. I also have jomsocial on if that makes a diffrence. I have seen people complain about it online that they can't login using IE and some figured out that they could if the removed the www. some of them made mention that the htaccess file needed to be changed to the following but it doesn't seem to do anything.

RewriteEngine On
RewriteBase /
RewriteCond %(HTTP HOST) ^mydomain.com [NC]
RewriteRule ^(.*) http://www.mydomain.com/$1 [L, R=301]


Top
 Profile  
 
PostPosted: Mon May 23, 2011 3:58 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Sat Apr 05, 2008 9:58 pm
Posts: 23363
Location: @Webdongle
Perhaps the position of the code is significant ? viewtopic.php?p=2499734#p2499734

_________________
http://weblinksonline.co.uk/joomla-faq.html


Top
 Profile  
 
PostPosted: Mon May 23, 2011 6:05 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue May 17, 2011 7:10 pm
Posts: 34
I deleted all the login modules and just reinstalled yoologin and I can now login using www with ie but I still have two different ways to login one using www and the other without it. I what I would like to have happen is for anytime someone types in just the domain name example google.com that it would redirect it to www.google.com.


Top
 Profile  
 
PostPosted: Mon May 23, 2011 6:15 pm 
User avatar
Joomla! Hero
Joomla! Hero

Joined: Mon Sep 21, 2009 6:56 am
Posts: 2065
Location: indore,india
browser treat www and non www as 2 different system
try this in .htaccess
Code:
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

_________________
abhijeet kurchania
The future depends on what you do today


Top
 Profile  
 
PostPosted: Mon May 23, 2011 6:53 pm 
Joomla! Guru
Joomla! Guru

Joined: Mon Feb 21, 2011 4:02 pm
Posts: 951
Location: UK
cyphergt wrote:
RewriteEngine On
RewriteBase /
RewriteCond %(HTTP HOST) ^mydomain.com [NC]
RewriteRule ^(.*) http://www.mydomain.com/$1 [L, R=301]

The %(HTTP_HOST) should be %{HTTP_HOST} here.
You MUST escape the literal periods in the pattern, so " . " should be " \. " here.
RewriteBase / is the default. You can delete this line.
The above code does not redirect all non-canonical hostnames. It fails to redirect www requests with appended port number or period.


kurchania wrote:
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

The above code fails to redirect non-www requests with appended port number or period.


Try this code (it fixes several issues):
Code:
########## Begin - 301 Redirect
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*(index|home)\.html?\ HTTP/
RewriteRule ^(([^/]+/)*)(index|home)\.html?$ http://www.example.com/$1 [R=301,L]
#
RewriteCond %{THE_REQUEST} !^POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/
RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^(([^/]+/)*)index\.php$ http%2://www.example.com/$1 [R=301,L]
#
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
#
########## End - 301 Redirect

I also urge you to use the new .htaccess file that comes with Joomla 1.5.23 onwards and Joomla 1.6.2 onwards. Look for the file called htaccess.txt in the installer package. It contains a note showing exactly where the redirects should go (in addition to a number of other changes). Add your new redirect code in the file at the point it says "redirects go here", or similar.

The rule order is critical. External redirects MUST be listed before internal rewrites. Additionally, once you have used RewriteRule in your .htaccess file you must NOT use Redirect or RedirectMatch at all.

_________________
Online since 1995.


Top
 Profile  
 
PostPosted: Mon May 23, 2011 8:41 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue May 17, 2011 7:10 pm
Posts: 34
Quote:
The above code fails to redirect non-www requests with appended port number or period.
I also urge you to use the new .htaccess file that comes with Joomla 1.5.23 onwards and Joomla 1.6.2 onwards. Look for the file called htaccess.txt in the installer package. It contains a note showing exactly where the redirects should go (in addition to a number of other changes). Add your new redirect code in the file at the point it says "redirects go here", or similar.

The rule order is critical. External redirects MUST be listed before internal rewrites. Additionally, once you have used RewriteRule in your .htaccess file you must NOT use Redirect or RedirectMatch at all.


I don't have .htaccess file I have a htaccess file minus the period if I add a period to the front of that file I can no longer view my site it takes me to Iana.org and I then have to go to godaddy to change the file type since fireftp won't allow me to view it.

Thanks to you I have a better understand of the htaccess file but I am puzzled by the fact that I never had and .htaccess file. I had read on one forum that it had to be created which I did and it resulted in the above.

So just to be clear are my marching orders to add your script to the htaccess file I have or do I need to make a .htaccess file?


Top
 Profile  
 
PostPosted: Mon May 23, 2011 8:55 pm 
Joomla! Guru
Joomla! Guru

Joined: Mon Feb 21, 2011 4:02 pm
Posts: 951
Location: UK
Use the htaccess.txt file that comes with Joomla OR better yet get the newer version of the file that comes with Joomla 1.5.23 onwards or Joomla 1.6.2 onwards and use that.

Add the above code to the htaccess.txt file in exactly the right place. In the new version of the htaccess.txt file that comes with Joomla 1.5.23 onwards and Joomla 1.6.2 onwards there is a specific place in the file that tells you "redirects go here". It is important to get the rules in the right order.

In the code you add, change www.example.com to be your own domain name. Do that in every place in the file where you see www.example.com. Where you see www\.example\.com also change that, but make sure the periods are done as " \. " not just as " . " each time.

Upload the file to the server and then rename it as .htaccess so that the server can use it.

_________________
Online since 1995.


Last edited by g1smd on Mon May 23, 2011 8:58 pm, edited 2 times in total.

Top
 Profile  
 
PostPosted: Mon May 23, 2011 8:57 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Sat Apr 05, 2008 9:58 pm
Posts: 23363
Location: @Webdongle
If you use Filezilla ftp client there is a setting to 'Force showing hidden files'
The . (full stop/period) denotes a hidden file.

Also gdddy cache their .htaccess files, so it may take a while before any changes show.

If your site does not work after following g1smd's instructions then the chances are that you made a (human) error following them.

_________________
http://weblinksonline.co.uk/joomla-faq.html


Top
 Profile  
 
PostPosted: Mon May 23, 2011 9:44 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue May 17, 2011 7:10 pm
Posts: 34
here is the htaccess.txt file with the changes

##
# @version $Id: htaccess.txt 21064 2011-04-03 22:12:19Z dextercowley $
# @package Joomla
# @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
# @license http://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)
#<Files ~ "\.xml$">
#Order allow,deny
#Deny from all
#Satisfy all
#</Files>
## End of deny access to extension xml files
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode data within the URL
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%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})
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
########## End - Rewrite rules to block out some common exploits


########## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*(index|home)\.html?\ HTTP/
RewriteRule ^(([^/]+/)*)(index|home)\.html?$ http://www.example.com/$1 [R=301,L]
#
RewriteCond %{THE_REQUEST} !^POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/
RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^(([^/]+/)*)index\.php$ http%2://www.example.com/$1 [R=301,L]
#
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
#

########## End - Custom redirects


# 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
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the request is for root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} (/[^.]*|\.(php|html?|feed|pdf|raw))$ [NC]
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
########## End - Joomla! core SEF Section


Top
 Profile  
 
PostPosted: Mon May 23, 2011 11:46 pm 
Joomla! Guru
Joomla! Guru

Joined: Mon Feb 21, 2011 4:02 pm
Posts: 951
Location: UK
As long as you have changed "example" to be your real domain name (in at least 4 places), you're ready to go.

_________________
Online since 1995.


Top
 Profile  
 
PostPosted: Tue May 24, 2011 12:10 am 
User avatar
Joomla! Master
Joomla! Master

Joined: Sat Apr 05, 2008 9:58 pm
Posts: 23363
Location: @Webdongle
Why have you got
www.example.com/
instead of your own url
???

_________________
http://weblinksonline.co.uk/joomla-faq.html


Top
 Profile  
 
PostPosted: Tue May 24, 2011 12:15 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue May 17, 2011 7:10 pm
Posts: 34
Sorry that's because all I did was put the script in I hadn't changed it yet but I did on mine here it is

##
# @version $Id: htaccess.txt 21064 2011-04-03 22:12:19Z dextercowley $
# @package Joomla
# @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
# @license http://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)
#<Files ~ "\.xml$">
#Order allow,deny
#Deny from all
#Satisfy all
#</Files>
## End of deny access to extension xml files
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode data within the URL
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%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})
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
########## End - Rewrite rules to block out some common exploits


########## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*(index|home)\.html?\ HTTP/
RewriteRule ^(([^/]+/)*)(index|home)\.html?$ http://www.askaliar.\com/$1 [R=301,L]
#
RewriteCond %{THE_REQUEST} !^POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/
RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^(([^/]+/)*)index\.php$ http%2://www.askaliar.\com/$1 [R=301,L]
#
RewriteCond %{HTTP_HOST} !^(www\.askaliar\.com)?$
RewriteRule (.*) http://www.askaliar\.com/$1 [R=301,L]
#

########## End - Custom redirects


# 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
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the request is for root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} (/[^.]*|\.(php|html?|feed|pdf|raw))$ [NC]
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
########## End - Joomla! core SEF Section


Top
 Profile  
 
PostPosted: Tue May 24, 2011 12:46 am 
Joomla! Guru
Joomla! Guru

Joined: Mon Feb 21, 2011 4:02 pm
Posts: 951
Location: UK
You completely messed up the instructions regarding " ." and " \. " here.

Where you see " www.example.com " put in your domain and retain the " . " between each part.

Where you see " www\.example\.com " put in your domain and retain the " \. " between each part.

Nowhere is " .\ " the correct thing to use.

_________________
Online since 1995.


Top
 Profile  
 
PostPosted: Tue May 24, 2011 12:53 am 
User avatar
Joomla! Master
Joomla! Master

Joined: Sat Apr 05, 2008 9:58 pm
Posts: 23363
Location: @Webdongle
:laugh:
I see the problem and you will laugh as well when you know it. :D

g1smd used bb tags [code ] and you used [quote

in normal and in [quote
The
{
looks like
(
If you click 'Quote' on his message you will see what I mean.


Computers are temperamental with precise text

_________________
http://weblinksonline.co.uk/joomla-faq.html


Top
 Profile  
 
PostPosted: Tue May 24, 2011 1:01 am 
User avatar
Joomla! Master
Joomla! Master

Joined: Sat Apr 05, 2008 9:58 pm
Posts: 23363
Location: @Webdongle
If g1smd confirms, then this is it
Remember to click 'Quote' at the bottom of the post, so that you see it clearly.

Code:
##
# @version $Id: htaccess.txt 21064 2011-04-03 22:12:19Z dextercowley $
# @package Joomla
# @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
# @license http://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)
#<Files ~ "\.xml$">
#Order allow,deny
#Deny from all
#Satisfy all
#</Files>
## End of deny access to extension xml files
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode data within the URL
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%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})
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
########## End - Rewrite rules to block out some common exploits


########## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#

########## Begin - 301 Redirect
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*(index|home)\.html?\ HTTP/
RewriteRule ^(([^/]+/)*)(index|home)\.html?$ http://www.askaliar.com/$1 [R=301,L]
#
RewriteCond %{THE_REQUEST} !^POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/
RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^(([^/]+/)*)index\.php$ http%2://www.askaliar.com/$1 [R=301,L]
#
RewriteCond %{HTTP_HOST} !^(www\.askaliar\.com)?$
RewriteRule (.*) http://www.askaliar.com/$1 [R=301,L]
#
########## End - 301 Redirect


########## End - Custom redirects


#  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
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the request is for root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} (/[^.]*|\.(php|html?|feed|pdf|raw))$ [NC]
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
########## End - Joomla! core SEF Section

_________________
http://weblinksonline.co.uk/joomla-faq.html


Top
 Profile  
 
PostPosted: Wed May 25, 2011 4:46 am 
User avatar
Joomla! Hero
Joomla! Hero

Joined: Mon Sep 21, 2009 6:56 am
Posts: 2065
Location: indore,india
@g1smd,
Quote:
The above code fails to redirect non-www requests with appended port number or period.

Code:
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

This code work perfect for me for last 3 year no issue
i never append port or period?thats something new
can you give me some real live example
@cyphergt
Rename htaccess.txt to .htaccess first.may be this doc is also usefull
http://docs.joomla.org/How_do_you_conve ... ss_file%3F
one more thing is it linux hosting or iis?

_________________
abhijeet kurchania
The future depends on what you do today


Top
 Profile  
 
PostPosted: Wed May 25, 2011 7:34 am 
Joomla! Guru
Joomla! Guru

Joined: Mon Feb 21, 2011 4:02 pm
Posts: 951
Location: UK
kurchania wrote:
This code work perfect for me for last 3 year no issue. I never append port or period? That's something new. Can you give me some real live example?

A request for example.com./ (trailing period) or for example.com:80/ (trailing port number) will not be redirected by your code. Your code fails to redirect these Duplicate Content non-canonical URLs. You leave your site open to malicious linking from other sites.

_________________
Online since 1995.


Top
 Profile  
 
PostPosted: Wed May 25, 2011 3:30 pm 
User avatar
Joomla! Hero
Joomla! Hero

Joined: Mon Sep 21, 2009 6:56 am
Posts: 2065
Location: indore,india
but i never see such things in live stuffs

_________________
abhijeet kurchania
The future depends on what you do today


Top
 Profile  
 
PostPosted: Wed May 25, 2011 4:35 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Sat Apr 05, 2008 9:58 pm
Posts: 23363
Location: @Webdongle
kurchania wrote:
but i never see such things in live stuffs

And I can't see elephants in my back garden either. Does that mean elephant's don't exist ?

_________________
http://weblinksonline.co.uk/joomla-faq.html


Top
 Profile  
 
PostPosted: Thu May 26, 2011 3:29 am 
User avatar
Joomla! Hero
Joomla! Hero

Joined: Mon Sep 21, 2009 6:56 am
Posts: 2065
Location: indore,india
@Webdongle
don't know about that elephant but its just i learn something new again for www htaccess redirection.
you can learn only when u face it in in real. ;D ;D
@g1smd
thanx for you clarification i will update my redirection code.

_________________
abhijeet kurchania
The future depends on what you do today


Top
 Profile  
 
PostPosted: Thu Mar 08, 2012 2:46 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Mar 08, 2012 2:40 pm
Posts: 21
Location: England
Hi, I know it's been a while since the last post here but I have a similar problem. I added the code from http://forum.joomla.org/viewtopic.php?t=692667 in the .htaccess file and then I was notified of a syntax error and since then my website redirects to http://www.iana.org/domains/example/. Even when I try to log into the backend to remove the change in the .htaccess file through domain/administrator I am redirected to the iana website! Can anyone help please?!


Top
 Profile  
 
PostPosted: Thu Mar 08, 2012 7:43 pm 
Joomla! Guru
Joomla! Guru

Joined: Mon Feb 21, 2011 4:02 pm
Posts: 951
Location: UK
Use FTP to log in to your site and then edit the .htaccess file.

Change example.com in the example code to be your actual website.

_________________
Online since 1995.


Top
 Profile  
 
PostPosted: Tue Mar 13, 2012 2:07 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Mar 08, 2012 2:40 pm
Posts: 21
Location: England
Thank you so much! I'm sorry for wasting your time. I renamed the .htaccess file and imported the original one. That restored everything to the way it was. I then edited the old .htaccess file and used the code you gave chenging example to my domain name and it has just worked. Thank you very much. It was a bit scary to see everypage of the domain including administrator log in redirecting to iana! All sorted. Thanks g1smd


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ] 



Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group