7

If you look at the session.php file, you see the following: public function isActive() { return (bool) ($this->_state == 'active'); } Which is the function you're calling. I'm not sure if this was done purposely or if it was a mistake, but it will always return 1. Instead, you use: $session = JFactory::getSession(); echo $session->getState(); ...


7

Passing the message via the redirect function is deprecated, but both redirect() and enqueueMessage() are still both fine to use on their own. You simply need to use both together, like so: $app = JFactory::getApplication(); $app->enqueueMessage('Redirect to another page was successful', 'success'); $app->redirect(JRoute::_('index.php')); ...


6

With the below .htaccess rule you can redirect all pages from a url with the pattern of: https://www.portal-gestao.com/whatever/whatever/9999-title-of-the-page to a new url of : https://www.portal-gestao.com/item/9999-title-of-the-page htaccess: RewriteEngine On RewriteCond %{HTTP_HOST} ^www.portal-gestao.com RewriteRule ^.*/.*/(.*)$ https://www....


6

I've used Nomad in the past - instead of redirecting, it's a system plugin that actually overrides the default home page and replaces it with your choice of locations based on User Groups.


5

Typically the only thing preventing direct access to a joomla file is a line at the top of the file: defined('_JEXEC') or die('Restricted access'); If that is not already at the top of the file, then you should have no trouble just accessing the file directly. The htaccess file redirect already has conditions to not redirect if the file or folder exists: ...


5

The solution I went with was to add the parameter (id) to the view's default.xml: <?xml version="1.0" encoding="utf-8"?> <metadata> <layout title="mycomponent"> <message>mycomponent message</message> </layout> <fields name="request"> <fieldset name="request"> <...


5

There are various techniques you can do to redirect an old domain to a new one and many depend on your server and site configuration. If you are hosting on Apache server, then one of the most common is to redirect all pages urls of the old domain to the corresponding pages of the new domain - using Apache's mod_rewrite - assuming you have kept the same ...


4

Try: $url = base64_encode(JUri::current()); $returnurl = JRoute::_('index.php?option=com_users&view=login&return='.$url, false); //false will make the URL non-xhtml $mainframe->redirect($returnurl,JText::_('Please Login'));


4

You can always use extension like this to redirect users on login: http://extensions.joomla.org/extensions/extension/access-a-security/site-access/redirect-on-login


4

I have not tested it with Redirect Component but you can not redirect url with GET parameters as they get passed in a different variable in Apache. So your source would be ignored. You would need to write it in the .htaccess file with extra settings: (not tested) RewriteCond %{QUERY_STRING} (^|&)query=param(&|$) [NC] RewriteCond %{REQUEST_URI} ^/...


4

An alternate solution , If you are developed the module in proper Joomla structure then instead of including Core Joomla framework to module file you can use com_ajax for making ajax call to module or plugin. If you're working with Web services and plan to use it in many sites so simple creates a Joomla module/Plugin and that can be acceed via ajax and ...


4

Answering my own question... I should have spend some time in google before asking my question. Joomla supports CSRF anti-spoofing and it is explained in How_to_add_CSRF_anti-spoofing_to_forms Since I am using GET method I should use the below while forming the HRF <?php echo JRoute::_( 'index.php?option=com_example&controller=object1&task=...


4

I had to face this problem recently. In most cases I saw the libraries folder hacked and I had to replace it with a clean one to see my website correctly. Here is what you can do: put on the root this https://github.com/mikestowe/Malicious-Code-Scanner/blob/master/phpMalCodeScanner.php , don't forget to put your email address. Then wait for the email ...


4

The best thing to do is to handle all redirects directly in sub controllers where you just need to use $this->setRedirect($url,$msg,$type); and MVC will do the rest of the job. If you need to redirect outside of controllers you can use JControllerLegacy class: $controller = JControllerLegacy::getInstance("ComponentName"); $controller->setRedirect($...


4

From the Joomla documentation:"This component is primarily used for redirecting URLs for web pages that no longer exist on your website to web pages that are working. The URL you want to redirect from must not be a working one on your website which actually loads a web page."https://docs.joomla.org/Help36:Components_Redirect_ManagerIf the page you are trying ...


3

You can use JOOMSEF component, which is for SEO purpose and more of this extension is free. Also in that component you have option to remove category and menu names from url and also you can customize the url according to you.


3

What you could do is use Joomla's Redirect Manager to redirect the old URL to the new one. In the Joomla backend, go to: Components >> Redirect >> New In the Source URL field, enter the old URL and in the Destination URL field, enter the new URL


3

In addition to redirecting then when they try to access the homepage, you can also redirect them once they have logged in. To do this, open the Login module in the Module Manager and you will see an option on the left called Login Redirection Page. For your main question though, this can't be achieved using htaccess, so instead you'll need to use PHP. At ...


3

You could write a template override for the login template being called when the standard login url is displayed. There you create a HTTP 302 Move response status. Or you write a url rewrite to your .htaccess. Both solutions could get you where you wanna be, but I would consider them 'dirty'.


3

Yes, Joomla records every URL request resulting in a 404 HTTP status code in the redirect component. The purpose is to provided an automated means for website administrators to manage redirects with the automatically logged 404 HTTP requests. More info on the component in the link below. http://docs.joomla.org/Help33:Components_Redirect_Manager


3

You can set a Menu-Item to be hidden, using Tab "Link Type" > "Display in Menu" set to "No" (3.7). So no need for an hidden Menu anymore.


3

The best method to check the hacked website is to scan the malware using this link : https://sitecheck.sucuri.net/ Here, all the malware content will be loaded and you can easily back track them. Enter your website URL in 'Scan your website' textbox and hit the scan button. Check for the results accordingly. Let me know further if it helps.


3

When you save the template with the JavaScript call saveTemplate(), you are sending an Ajax call to the server. This Ajax call is the one being redirected with a HTTP redirect. You are ignoring the response from the server. If you checked it out, it would be the content of the page that you're trying to redirect to. To issue a redirect after the Ajax call ...


3

The first problem is that you're using joomlausers->id which doesn't look correct. It should be $joomlausers->id (with a $ at the beginning). Secondly, loadObjectList() returns an indexed array of PHP objects, so I don't believe in_array will work with this. Instead, I'd suggest using $db->loadColumn(), which will return an array of all userid's, ...


3

I don't think it is very direct to filter the result set when sql is perfectly qualified to do such logic. As Lodder corrected, you also need to use setQuery(), fix your missing $, adjust your result set generating method call, and improve your redirect technique. I've included some helpful diagnostic lines to help you to understand the query that is being ...


2

There seems to be a problem with the generated redirect URL. Example: When using the login module to log in, the URL for the article "Traditional round nosed bear" is this: index.php?option=com_content&view=article&id=10:traditional-round-nosed-bear&catid=23&Itemid=103 However, when using the "Login or Subscribe to read more..." button to ...


2

This is looping behavior, but I can't pinpoint the cause from the information given. What it is implying is that it's trying to link http://website.com/firstaddress to redirect to http://website.com/secondaddress and that http://website.com/secondaddress either links to firstaddress or something different, throwing the whole site into an endless wild goose ...


2

There is actually a very simple way to do it in Joomla 3x. Go to Users > Access Levels and click on the Guest access level. By default, under User Groups Having Viewing Access, only Guest is checked. Check the Public box as well and then click Save. Go to your menu and click on the Home link to edit it. In the Access drop down on the right hand side, set it ...


2

use a redirect in your .htaccess file RewriteEngine on Redirect 301 /purchase/buy-here.html /shop.html


Only top voted, non community-wiki answers of a minimum length are eligible