test
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • sadesh Friend
    #153989

    I 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 use

    RewriteEngine 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 exploits

    rewritecond %{http_host} ^site.com [nc]

    rewriterule ^(.*)$ http://www.site.com/$1 [r=301,nc]

    gray Friend
    #354384

    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]

    sadesh Friend
    #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 Friend
    #354407

    Do you use Linux-based on Windows-based hosting service now?
    Some docs on URL re-writing under IIS7 (for IIS6 3rd party add-on is needed)

    sadesh Friend
    #354430

    <em>@gray 192530 wrote:</em><blockquote>Do you use Linux-based on Windows-based hosting service now?
    Some docs on URL re-writing under IIS7 (for IIS6 3rd party add-on is needed)</blockquote>

    Linux with Cpanel. I tried most of the options…still no luck.

    gray Friend
    #354444

    Hmm….
    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…

    Manos Moderator
    #354446

    Or use the DNS editor that the new version of cPanel has to redirect all to www

    sadesh Friend
    #354537

    The 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>

Viewing 8 posts - 1 through 8 (of 8 total)

This topic contains 8 replies, has 3 voices, and was last updated by  sadesh 14 years, 3 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum