Showing posts with label joomla 3. Show all posts
Showing posts with label joomla 3. Show all posts

Thursday, December 22, 2016

joomla 301 redirection from with index.php to without URLs

This can be done using .htaccess file. Open it and add the following code

RewriteEngine On

########## Begin - 301 Redirect

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*(index|home)\.html?\ HTTP/
RewriteRule ^(([^/]+/)*)(index|home)\.html?$ http://www.yourdomain.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.yourdomain.com/$1 [R=301,L]

#RedirectMatch 301 ^/index.php/(.*)$ http://www.yourdomain.com/$1

RewriteCond %{REQUEST_URI} ^/index\.php/
RewriteRule ^index.php/(.*) /$1 [R,L]

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


*****************************************************************
 
RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ http://www.yourdomain.com [R=301,L] 
 
RewriteCond %{REQUEST_URI} ^/index\.php/
RewriteRule ^index.php/(.*) /$1 [R,L] 

Thursday, March 10, 2016

Joomla 3 - Get article intro Image by article Id


Here the following post is useful to get article images from the article id in joomla3.

$article_id = JFactory::getApplication()->input->get('id'); // get article id

$article = JTable::getInstance("content");
$article->load(JRequest::getInt("id")); // Get Article ID
$article_images = $article->get("images"); // Get image parameters
$pictures = json_decode($article_images); // Split the parameters apart

// Print the image
echo "<img src='" . $pictures->image_intro . "' alt='" . $pictures->image_intro_alt . "'>";

Good Luck!! Cheers :)