-
AuthorPosts
-
sadesh Friend
sadesh
- Join date:
- March 2009
- Posts:
- 63
- Downloads:
- 0
- Uploads:
- 5
- Thanks:
- 26
- Thanked:
- 2 times in 1 posts
September 1, 2010 at 6:42 pm #153989I use a similar code to add www in my other joomla site hosted in a different server. I tried the same for my new site, it just didn’t work.
Could you help me resolve this issue? thank you!
##
# @version $Id: htaccess.txt 4756 2006-08-25 16:07:11Z stingrey $
# @package Joomla
# @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##AddDefaultCharset UTF-8
## Can be commented out if causes errors
Options FollowSymLinks#
# mod_rewrite in useRewriteEngine On
# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla/MamboDirectory (just / for root)RewriteBase /
########## Begin - 3rd Party SEF Section
############# Use this section if you are using a 3rd party (Non Joomla! core) SEF extension - e.g. OpenSEF, 404_SEF, 404SEFx, SEF Advance, etc
#
RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
RewriteCond %{REQUEST_URI} (/|.htm|.php|.html|/[^.]*)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php
#
########## End - 3rd Party SEF Section########## 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!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_{1,21}(=|%3D)
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*(.*)
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|{0,2})
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|{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 exploitsrewritecond %{http_host} ^site.com [nc]
rewriterule ^(.*)$ http://www.site.com/$1 [r=301,nc]
gray Friendgray
- Join date:
- October 2009
- Posts:
- 957
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 28
- Thanked:
- 292 times in 230 posts
September 1, 2010 at 7:24 pm #354384What I found on Joomla forum differs a little bit from your code (last 2 lines)
RewriteCond %{HTTP_HOST} ^joomlatags.org$ [NC]
RewriteRule ^(.*)$ http://www.joomlatags.org/$1 [L,R=301]
other option found is
RewriteCond %{HTTP_HOST} ^yoursite.com [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L]
1 user says Thank You to gray for this useful post
sadesh Friendsadesh
- Join date:
- March 2009
- Posts:
- 63
- Downloads:
- 0
- Uploads:
- 5
- Thanks:
- 26
- Thanked:
- 2 times in 1 posts
September 1, 2010 at 8:23 pm #354390<em>@gray 192504 wrote:</em><blockquote>What I found on Joomla forum differs a little bit from your code (last 2 lines)
RewriteCond %{HTTP_HOST} ^joomlatags.org$ [NC]
RewriteRule ^(.*)$ http://www.joomlatags.org/$1 [L,R=301]
other option found is
RewriteCond %{HTTP_HOST} ^yoursite.com [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L]
</blockquote>thanks Gray. Tried both the options with
RewriteEngine On
None works. 🙁
gray Friendgray
- Join date:
- October 2009
- Posts:
- 957
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 28
- Thanked:
- 292 times in 230 posts
sadesh Friendsadesh
- Join date:
- March 2009
- Posts:
- 63
- Downloads:
- 0
- Uploads:
- 5
- Thanks:
- 26
- Thanked:
- 2 times in 1 posts
gray Friendgray
- Join date:
- October 2009
- Posts:
- 957
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 28
- Thanked:
- 292 times in 230 posts
September 2, 2010 at 6:19 pm #354444Hmm….
Do you add those to lines right after RewriteEngine On (in your code at the first post it’s separated, rules are added at the end)….
Contact your hoster and check Apache mod_rewrite is working property….
If you use any 3rd party SEF tools, disable them during tests…1 user says Thank You to gray for this useful post
Manos ModeratorManos
- Join date:
- February 2014
- Posts:
- 2806
- Downloads:
- 46
- Uploads:
- 56
- Thanks:
- 200
- Thanked:
- 633 times in 576 posts
sadesh Friendsadesh
- Join date:
- March 2009
- Posts:
- 63
- Downloads:
- 0
- Uploads:
- 5
- Thanks:
- 26
- Thanked:
- 2 times in 1 posts
September 3, 2010 at 3:27 pm #354537The problem is now resolved by my host.
<blockquote>RewriteEngine on
RewriteCond %{HTTP_HOST} ^site.com [NC]
RewriteRule ^(.*)$ http://www.site.com/$1 [R=301,L]</blockquote> -
AuthorPosts
This topic contains 8 replies, has 3 voices, and was last updated by sadesh 14 years, 2 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum