1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Joomla help please!

Discussion in 'Black Hat SEO' started by rugbyjack2005, Jun 27, 2012.

  1. rugbyjack2005

    rugbyjack2005 Power Member

    Joined:
    Oct 2, 2011
    Messages:
    539
    Likes Received:
    50
    Location:
    United Kingdom
    Hi,

    I added a .htaccess file recently to a clients site redirecting the non www. traffic to the www version of the site. Its the standard code that i use for all clients and i have never had a problem with it. Afterwards i checked that it works and it appeared to work fine. I can't remember for certain if i just checked the homepage or if i checked the internal pages too. The web developer that built the site has done work since on the site.

    I got an email the other day saying that the internal pages don't work and asking if i have changed anything on the site. I obviously said about the .htaccess file and deleted the code and uploaded the changes. I don't have access to the server so i can't delete it on there. The developer is being less than helpful and trying to charge me to look into it. I don't know if it makes a difference but it's got a static homepage for some reason.

    Given that the .htaccess file is now blank and the site still doesn't work, could i have caused the problem and if so, how do i fix it?

    Will give thanks and rep if you can help me fix the prob!
     
  2. hassan_isabad_subar

    hassan_isabad_subar Jr. VIP Jr. VIP

    Joined:
    May 23, 2012
    Messages:
    260
    Likes Received:
    70
    Occupation:
    BHProxies Staff
    Home Page:
    I use joomla a bit, not an expert but if I had to guess, his internal pages might have been screwed up since they were probably written as http creating a conflict with what you wrote into htaccess. If I were you, I'd imagine you'd get a better response over at joomla's forums.
     
  3. cdenet

    cdenet Registered Member

    Joined:
    Apr 25, 2009
    Messages:
    80
    Likes Received:
    41
    Occupation:
    SEO
    Location:
    Detroit, USA
    If your rewrite rules work on other Joomla sites, then it's probably an extension.
    I would:
    1. Turn off everything but the core extensions.
    2. Revert to the standard Joomla theme.
    3. Add and Test your rewrite rules
    4. Turn extensions on one-at-a-time and evaluate

    Did you hire the developer or did the client. If you did, kick his ass. If it was the client - tell them the developer changed the site after you and messed it up.

    My advice.
     
    • Thanks Thanks x 1
  4. rugbyjack2005

    rugbyjack2005 Power Member

    Joined:
    Oct 2, 2011
    Messages:
    539
    Likes Received:
    50
    Location:
    United Kingdom
    Sorry, i wasn't overly clear before. The client hired the developer when the site was built and working before the client employed me. The client obviously bought a CMS site thinking he could manage it himself but doesn't know how to use it at all. To be fair to him, i had a look at it and i was pretty lost too. Basically the developer that built it is not really a developer and i am pretty sure he outsourced the work.

    I altered the title and description tags etc. but needed to ask the developer how to do it as it wasn't straight forward at all and then got on with my link cycle (a month ago now). The site worked fine. I added the .htaccess file a couple of weeks ago. Between this time and the site not working, the developer changed the description tag on the homepage. I then got an email saying the internal pages are not working. It could have been the .htaccess file or it could have been the developer changing the description tag. I'm very conscientious so wanted to make sure it wasn't me and fix the problem if it was.

    I have used quite a few CMS systems by never Joomla. I don't know Joomla at all. The .htaccess file was the one i use on other sites (not Joomla ones). Should the code be different for Joomla?

    The code in the .htaccess file was:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^site.com
    RewriteRule (.*) http://www.site.com/$1 [R=301,L]
     
  5. lensman

    lensman Newbie

    Joined:
    Jun 16, 2011
    Messages:
    8
    Likes Received:
    19
    I have been a technical developer for over 27 years and have some experience with Joomla.
    From my experience you are in the same boat as a user with a virus infection. No matter what you
    do, you will never be absolutely sure that the system is clean.

    At this point you could consider:

    1. Rebuild the Joomla system from scratch. Waste of time. You are still stuck with Joomla.

    2. Convince the user to migrate to Wordpress. Joomla is a security nightmare among other problems.
    There are some third party companies that specialize in this and can do a conversion for around $100 or so.
    You get the Wordpress theme and set up the categories, menus, etc and they do they database conversion
    to bring in the existing content, etc

    3. Walk away and let someone else fix it. I once knew an IBM engineer that worked on IBM 370 mainframes.
    He said that outstanding problem logs were how he knew when to change companies. When the problems
    grew to a certain level, he looked for a job at another IBM install.

    Hope this helps,

    Lensman
     
    • Thanks Thanks x 1
  6. rugbyjack2005

    rugbyjack2005 Power Member

    Joined:
    Oct 2, 2011
    Messages:
    539
    Likes Received:
    50
    Location:
    United Kingdom
    Thanks but all i really want to do is make sure it isn't me that has screwed it up. Would the .htaccess file i uploaded cause this problem even though it is now blank?
     
  7. fairhaven73

    fairhaven73 Registered Member

    Joined:
    Aug 22, 2011
    Messages:
    63
    Likes Received:
    28
    Location:
    Seattle
    I've got bunch of Joomla sites. Let's see If I can be of any help.

    When they said...internal pages don't work. What kind of error did they get?

    Was it any of following:

    • Error 401 - Authorization Required
    • Error 403 - Forbidden
    • Error 404 - Not Found
    • Error 500 - Internal Server Error

    Or did they mean, the rewrite you put in for non www to www, doesn't work for internal pages?

    Also, you said you don't have the access to the server. So who deleted the .htaccess file?
    Was it the developer?

    I can't post the code for .htaccess here...so pm me and I can send you the txt file.
     
  8. jtech

    jtech Newbie

    Joined:
    Apr 23, 2010
    Messages:
    16
    Likes Received:
    2
    Occupation:
    SEO/Reputation Management
    have you tried downloading joomla and using the default .htaccess? b/c it's most likely using mod rewrite.
     
  9. rugbyjack2005

    rugbyjack2005 Power Member

    Joined:
    Oct 2, 2011
    Messages:
    539
    Likes Received:
    50
    Location:
    United Kingdom
    Ok, so i am making progress. I have uploaded a Joomla .htaccess file that i got online (see below) but the file is very long and it adds long query strings to the URLs but on the plus side, the page do work which is definitely progress. By chance, do you have a standard .htaccess code that i can use that will not add the query strings? It is Joomla 1.5 with mod_rewrite on.

    ##
    # @version $Id: BASED ON htaccess.txt 14401 2010-01-26 14:10:00Z louis $
    # @MODIFIED 2011-02-25
    # @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.
    #
    ########## 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
     
  10. rugbyjack2005

    rugbyjack2005 Power Member

    Joined:
    Oct 2, 2011
    Messages:
    539
    Likes Received:
    50
    Location:
    United Kingdom
    Just to be clear, the .htaccess file above changes the URL from

    domain.com/page-name

    to

    domain.com/websites/123reg/LinuxPackage25/pj/lp/ro/domain.com/public_html/page-name
     
  11. fairhaven73

    fairhaven73 Registered Member

    Joined:
    Aug 22, 2011
    Messages:
    63
    Likes Received:
    28
    Location:
    Seattle
    If you want, I can give you a copy of my .htaccess file from joomla 1.5 website.
    It is pretty similar to what you posted but may be slight different.

    I can't post the code here...because it's triggering some error. I guess I don't have
    enough posts to post a link.

    Just pm me if you need it.
     
    • Thanks Thanks x 1
  12. rugbyjack2005

    rugbyjack2005 Power Member

    Joined:
    Oct 2, 2011
    Messages:
    539
    Likes Received:
    50
    Location:
    United Kingdom
    Thanks, PM sent
     
  13. stoichen

    stoichen Newbie

    Joined:
    Jan 6, 2009
    Messages:
    46
    Likes Received:
    10
    Location:
    Scotland
    Below is a working .htaccess file from a client site, I've just changed their domain name to domain.com.

    The Options +SymLinksIfOwnerMatch has caused me problems before, but commenting it out usually sorts it.

    I've found adding my own rules will cause problems if I don't do it before the ########## Begin - Rewrite rules to block out some common exploits section.

    I would try switching of the SEF URLS and mod_rewrite in global configuration and having a look at the URLs, they should be index.php?option=com_content&view=article&id=1&itemid=1 or similar. If they don't look like this then I would wager that an extension is causing a problem or that the developer hasn't set it up very well.


    Code:
    ##
    # @version $Id: htaccess.txt 10492 2008-07-02 06:38:28Z ircmaxell $
    # @package Joomla
    # @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
    # @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
    # Joomla! is Free Software
    ##
    
    Redirect 301 /home.html http://www.domain.com
    
    
    #####################################################
    #  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 +SymLinksIfOwnerMatch
    
    #
    #  mod_rewrite in use
    
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^domain.com
    RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
    
    ########## 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_[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 <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-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
    
    
     
    • Thanks Thanks x 1
  14. fairhaven73

    fairhaven73 Registered Member

    Joined:
    Aug 22, 2011
    Messages:
    63
    Likes Received:
    28
    Location:
    Seattle
    Just replied to your PM. Make sure you check the backend.

    Apache rewrite should be on. And SEF url should also be on.
    For adding suffix to url- select no.

    Before doing any of above, upload .htaccess file.
     
    • Thanks Thanks x 1
  15. rugbyjack2005

    rugbyjack2005 Power Member

    Joined:
    Oct 2, 2011
    Messages:
    539
    Likes Received:
    50
    Location:
    United Kingdom
    All fixed now. It was not easy and very frustrating. It turned out that the rewrite code that i added was not the problem, the problem was caused by the developer who changed the description tag. The developer blamed me though and wanted to charge me for fixing the problem that he had caused. I had to fix it to prove that it wasn't me though. I could then go back to the client and the developer that it wasn't me and now the developer looks like a knob!

    What i did with the help of a couple of BHW members:

    1). Added standard Apache mod_rewrite (thanks fairhaven73). This got the site working but the URLs in the internal pages were not right. Effectively Joomla could locate the file and saw it as an empty variable so didn't know where the article base was.
    2). Changed the code in the uri.php file (thanks artizhay). My techy brain had exploded by this point so artizhay very kindly stepped in. The site path had been messed up and there is no admin setting to change the live_site path so god knows how the developer managed it. Artizhay managed to get around this by manually overriding in the uri.php file.
    3) Wrote to the client telling him that it was all fixed and explained the faults and how it couldn't have possibly have been me that caused it. I then asked for all of the passwords to be changed so that i didn't have any access so that i couldn't be blamed for future faults.
    4)Wrote to the developer and told him he was a dick for not only screwing it up but for trying to blame me and trying to charge me for fixing his fault
     
    • Thanks Thanks x 1
  16. stoichen

    stoichen Newbie

    Joined:
    Jan 6, 2009
    Messages:
    46
    Likes Received:
    10
    Location:
    Scotland
    Glad you got it sorted mate and thanks for sharing the solution for anyone facing a similar problem.

    Regarding the live_site variable, this is normally found in configuration.php, which is also where the global meta description is stored. Sounds like the developer has messed this up whilst fiddling with the description.