SkyMagento_Redirect - Version 0.1.0

Version Notes

This extension is delivered free of charge as a showcase of SkyMagento solutions on Magento Connect.

Download this release

Release Info

Developer Farhan Islam
Extension SkyMagento_Redirect
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

app/code/local/SkyMagento/Redirect/Block/Info.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * SkyMagento Solutions
4
+ *
5
+ * @category SkyMagento
6
+ * @package SkyMagento_Redirect
7
+ * @copyright Copyright (c) 2003-2009 SkyMagento Solutions. (http://www.SkyMagento.com)
8
+ */
9
+
10
+
11
+ class SkyMagento_Redirect_Block_Info extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
12
+ {
13
+ public function render(Varien_Data_Form_Element_Abstract $element)
14
+ {
15
+
16
+ $html = $this->_getHeaderHtml($element);
17
+
18
+ $html.= $this->_getFieldHtml($element);
19
+
20
+ $html .= $this->_getFooterHtml($element);
21
+
22
+ return $html;
23
+ }
24
+
25
+
26
+
27
+ protected function _getFieldHtml($fieldset)
28
+ {
29
+ $content = 'This module is developed by <a href="http://www.skymagento.com/">SkyMagento.com</a> to offer client a new customized default 404 replacement with 301 permanent redirect to homepage. This should fix any SEO errors after migrating to Magento. Please note its not recomended to use this extension for life but as long as your old link structure is fully fixed in Search Engines.';
30
+ return $content;
31
+ }
32
+ }
app/code/local/SkyMagento/Redirect/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class SkyMagento_Redirect_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/local/SkyMagento/Redirect/controllers/IndexController.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once "Mage/Cms/controllers/IndexController.php";
3
+
4
+ class SkyMagento_Redirect_IndexController extends Mage_Cms_IndexController
5
+ {
6
+ public function noRouteAction($coreRoute = null)
7
+ {
8
+ $configValue = Mage::getStoreConfig('redirect/settings/status', Mage::app()->getStore());
9
+ if($configValue)
10
+ {
11
+ header("HTTP/1.1 301 Moved Permanently");
12
+ header("Location: ".Mage::helper('core/url')->getHomeUrl());
13
+ exit();
14
+ }
15
+ return parent::noRouteAction($coreRoute = null);
16
+ }
17
+ }
app/code/local/SkyMagento/Redirect/etc/config.xml ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <SkyMagento_Redirect>
5
+ <version>0.1.0</version>
6
+ </SkyMagento_Redirect>
7
+ </modules>
8
+
9
+ <global>
10
+ <blocks>
11
+ <redirect>
12
+ <class>SkyMagento_Redirect_Block</class>
13
+ </redirect>
14
+ </blocks>
15
+ <models>
16
+ <redirect>
17
+ <class>SkyMagento_Redirect_Model</class>
18
+ </redirect>
19
+ </models>
20
+ <helpers>
21
+ <redirect>
22
+ <class>SkyMagento_Redirect_Helper</class>
23
+ </redirect>
24
+ </helpers>
25
+ <resources>
26
+ <redirect_setup>
27
+ <setup>
28
+ <module>SkyMagento_Redirect</module>
29
+ </setup>
30
+ <connection>
31
+ <use>core_setup</use>
32
+ </connection>
33
+ </redirect_setup>
34
+ </resources>
35
+ </global>
36
+ <adminhtml>
37
+ <translate>
38
+ <modules>
39
+ <SkyMagento_Redirect>
40
+ <files>
41
+ <default>SkyMagento_Redirect.csv</default>
42
+ </files>
43
+ </SkyMagento_Redirect>
44
+ </modules>
45
+ </translate>
46
+ <acl>
47
+ <resources>
48
+ <admin>
49
+ <children>
50
+ <system>
51
+ <children>
52
+ <config>
53
+ <children>
54
+ <redirect translate="title" module="redirect">
55
+ <title>404 Redirect Replacement With 301 Permanent Redirect</title>
56
+ </redirect>
57
+ </children>
58
+ </config>
59
+ </children>
60
+ </system>
61
+ </children>
62
+ </admin>
63
+ </resources>
64
+ </acl>
65
+ </adminhtml>
66
+
67
+ <frontend>
68
+ <routers>
69
+ <cms>
70
+ <args>
71
+ <modules>
72
+ <SkyMagento_Redirect before="Mage_Cms">SkyMagento_Redirect</SkyMagento_Redirect>
73
+ </modules>
74
+ </args>
75
+ </cms>
76
+ </routers>
77
+ </frontend>
78
+ <default>
79
+ <redirect>
80
+ <settings>
81
+ <status>1</status>
82
+ </settings>
83
+ </redirect>
84
+ </default>
85
+ </config>
app/code/local/SkyMagento/Redirect/etc/system.xml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category SkyMagento
5
+ * @package SkyMagento_Redirect
6
+ */
7
+ -->
8
+ <config>
9
+ <tabs>
10
+ <skymagento translate="label">
11
+ <label>SkyMagento Modules</label>
12
+ <sort_order>250</sort_order>
13
+ </skymagento>
14
+ </tabs>
15
+ <sections>
16
+ <redirect translate="label" module="redirect">
17
+ <label>SEO 404 Replacement</label>
18
+ <tab>skymagento</tab>
19
+ <frontend_type>text</frontend_type>
20
+ <sort_order>100</sort_order>
21
+ <show_in_default>1</show_in_default>
22
+ <show_in_website>1</show_in_website>
23
+ <show_in_store>1</show_in_store>
24
+ <groups>
25
+ <settings translate="label">
26
+ <label>Settings</label>
27
+ <frontend_type>text</frontend_type>
28
+ <sort_order>10</sort_order>
29
+ <show_in_default>1</show_in_default>
30
+ <show_in_website>1</show_in_website>
31
+ <show_in_store>1</show_in_store>
32
+ <fields>
33
+ <status translate="label">
34
+ <label>Enable</label>
35
+ <frontend_type>select</frontend_type>
36
+ <source_model>adminhtml/system_config_source_yesno</source_model>
37
+ <sort_order>50</sort_order>
38
+ <show_in_default>1</show_in_default>
39
+ <show_in_website>1</show_in_website>
40
+ <show_in_store>1</show_in_store>
41
+ </status>
42
+ </fields>
43
+ </settings>
44
+ <info translate="label">
45
+ <label>Author Info</label>
46
+ <frontend_type>text</frontend_type>
47
+ <frontend_model>redirect/info</frontend_model>
48
+ <sort_order>50</sort_order>
49
+ <show_in_default>1</show_in_default>
50
+ <show_in_website>0</show_in_website>
51
+ <show_in_store>0</show_in_store>
52
+ </info>
53
+ </groups>
54
+ </redirect>
55
+ </sections>
56
+ </config>
app/etc/modules/SkyMagento_Redirect.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <SkyMagento_Redirect>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </SkyMagento_Redirect>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>SkyMagento_Redirect</name>
4
+ <version>0.1.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This module overrides 404 page with 301 permanent redirect to homepage</summary>
10
+ <description>This module is developed by &lt;a href="http://www.skymagento.com/services/" target="_blank"&gt;SkyMagento Solustions&lt;/a&gt; to offer users a new customized way to override default 404 page with 301 permanent redirect to homepage.&#xD;
11
+ This should fix any SEO errors after migrating to Magento. Please note its not recommended to use this extension for life but as long as your old link structure is fully fixed in Search Engines.&#xD;
12
+ </description>
13
+ <notes>This extension is delivered free of charge as a showcase of SkyMagento solutions on Magento Connect.</notes>
14
+ <authors><author><name>Farhan Islam</name><user>askwhyweb</user><email>farhan@askwhyweb.com</email></author></authors>
15
+ <date>2014-07-24</date>
16
+ <time>17:21:15</time>
17
+ <contents><target name="magelocal"><dir name="SkyMagento"><dir name="Redirect"><dir name="Block"><file name="Info.php" hash="8f38681900ec65c2ba8c6c26185cd904"/></dir><dir name="Helper"><file name="Data.php" hash="036d08bd6986d50102accf79f8bb93ad"/></dir><dir name="controllers"><file name="IndexController.php" hash="ffe6ec04388d8ee528b3885a40b062d0"/></dir><dir name="etc"><file name="config.xml" hash="2984fc589a5d60c3fbbf792ccf3ee57c"/><file name="system.xml" hash="eec08e91c4b2e772df431839cb4de12b"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="SkyMagento_Redirect.xml" hash="e4fcec4413e27169f7d695dec9f5a413"/></dir></target></contents>
18
+ <compatible/>
19
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>SkyMagento_Redirect</name><channel>community</channel><min>1.5.0.0</min><max>1.9.5</max></package></required></dependencies>
20
+ </package>