Version Notes
New update with two new features.
* Improved CSV file support
* Ability to provide query string based redirects
* Old CSV will still work as the first option
Download this release
Release Info
Developer | Kathir Vel |
Extension | Optimiseweb_Redirects |
Version | 0.1.7 |
Comparing to | |
See all releases |
Code changes from version 0.1.5 to 0.1.7
- app/code/community/Optimiseweb/Redirects/Block/System/Config/Backend/Download.php +5 -3
- app/code/community/Optimiseweb/Redirects/Block/System/Config/Backend/Download1.php +32 -0
- app/code/community/Optimiseweb/Redirects/Block/System/Config/Backend/Downloadquerystringfile.php +30 -0
- app/code/community/Optimiseweb/Redirects/Model/Redirector.php +110 -14
- app/code/community/Optimiseweb/Redirects/etc/adminhtml.xml +33 -33
- app/code/community/Optimiseweb/Redirects/etc/config.xml +96 -69
- app/code/community/Optimiseweb/Redirects/etc/system.xml +150 -50
- app/locale/en_US/Optimiseweb_Redirects.csv +0 -0
- package.xml +8 -5
app/code/community/Optimiseweb/Redirects/Block/System/Config/Backend/Download.php
CHANGED
@@ -8,7 +8,8 @@
|
|
8 |
* @copyright Copyright (c) 2013 Optimise Web Limited
|
9 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
*/
|
11 |
-
class Optimiseweb_Redirects_Block_System_Config_Backend_Download extends Mage_Adminhtml_Block_System_Config_Form_Field
|
|
|
12 |
|
13 |
/**
|
14 |
* Get the system config field and insert a HTML link
|
@@ -16,7 +17,8 @@ class Optimiseweb_Redirects_Block_System_Config_Backend_Download extends Mage_Ad
|
|
16 |
* @param Varien_Data_Form_Element_Abstract $element
|
17 |
* @return string
|
18 |
*/
|
19 |
-
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
|
|
20 |
$this->setElement($element);
|
21 |
if (Mage::getStoreConfig('optimisewebredirects/general/upload')) {
|
22 |
$url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'optimiseweb/redirects/' . Mage::getStoreConfig('optimisewebredirects/general/upload');
|
@@ -27,4 +29,4 @@ class Optimiseweb_Redirects_Block_System_Config_Backend_Download extends Mage_Ad
|
|
27 |
return $html;
|
28 |
}
|
29 |
|
30 |
-
}
|
8 |
* @copyright Copyright (c) 2013 Optimise Web Limited
|
9 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
*/
|
11 |
+
class Optimiseweb_Redirects_Block_System_Config_Backend_Download extends Mage_Adminhtml_Block_System_Config_Form_Field
|
12 |
+
{
|
13 |
|
14 |
/**
|
15 |
* Get the system config field and insert a HTML link
|
17 |
* @param Varien_Data_Form_Element_Abstract $element
|
18 |
* @return string
|
19 |
*/
|
20 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
21 |
+
{
|
22 |
$this->setElement($element);
|
23 |
if (Mage::getStoreConfig('optimisewebredirects/general/upload')) {
|
24 |
$url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'optimiseweb/redirects/' . Mage::getStoreConfig('optimisewebredirects/general/upload');
|
29 |
return $html;
|
30 |
}
|
31 |
|
32 |
+
}
|
app/code/community/Optimiseweb/Redirects/Block/System/Config/Backend/Download1.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Optimiseweb Redirects Block System Config Backend Download1
|
5 |
+
*
|
6 |
+
* @package Optimiseweb_Redirects
|
7 |
+
* @author Kathir Vel (sid@optimiseweb.co.uk)
|
8 |
+
* @copyright Copyright (c) 2013 Optimise Web Limited
|
9 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
+
*/
|
11 |
+
class Optimiseweb_Redirects_Block_System_Config_Backend_Download1 extends Mage_Adminhtml_Block_System_Config_Form_Field
|
12 |
+
{
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Get the system config field and insert a HTML link
|
16 |
+
*
|
17 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
18 |
+
* @return string
|
19 |
+
*/
|
20 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
21 |
+
{
|
22 |
+
$this->setElement($element);
|
23 |
+
if (Mage::getStoreConfig('optimisewebredirects/redirects1/upload')) {
|
24 |
+
$url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'optimiseweb/redirects/' . Mage::getStoreConfig('optimisewebredirects/redirects1/upload');
|
25 |
+
$html = "<a href='" . $url . "'>Download</a>";
|
26 |
+
} else {
|
27 |
+
$html = "No CSV file provided.";
|
28 |
+
}
|
29 |
+
return $html;
|
30 |
+
}
|
31 |
+
|
32 |
+
}
|
app/code/community/Optimiseweb/Redirects/Block/System/Config/Backend/Downloadquerystringfile.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Optimiseweb Redirects Block System Config Backend Downloadquerystringfile
|
5 |
+
*
|
6 |
+
* @package Optimiseweb_Redirects
|
7 |
+
* @author Kathir Vel (sid@optimiseweb.co.uk)
|
8 |
+
* @copyright Copyright (c) 2013 Optimise Web Limited
|
9 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
+
*/
|
11 |
+
class Optimiseweb_Redirects_Block_System_Config_Backend_Downloadquerystringfile extends Mage_Adminhtml_Block_System_Config_Form_Field {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Get the system config field and insert a HTML link
|
15 |
+
*
|
16 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
17 |
+
* @return string
|
18 |
+
*/
|
19 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
|
20 |
+
$this->setElement($element);
|
21 |
+
if (Mage::getStoreConfig('optimisewebredirects/querystring/upload')) {
|
22 |
+
$url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'optimiseweb/redirects/' . Mage::getStoreConfig('optimisewebredirects/querystring/upload');
|
23 |
+
$html = "<a href='" . $url . "'>Download</a>";
|
24 |
+
} else {
|
25 |
+
$html = "No CSV file provided.";
|
26 |
+
}
|
27 |
+
return $html;
|
28 |
+
}
|
29 |
+
|
30 |
+
}
|
app/code/community/Optimiseweb/Redirects/Model/Redirector.php
CHANGED
@@ -8,7 +8,8 @@
|
|
8 |
* @copyright Copyright (c) 2013 Optimise Web Limited
|
9 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
*/
|
11 |
-
class Optimiseweb_Redirects_Model_Redirector
|
|
|
12 |
|
13 |
/**
|
14 |
* Redirect Function
|
@@ -17,29 +18,124 @@ class Optimiseweb_Redirects_Model_Redirector {
|
|
17 |
*
|
18 |
* @param Varien_Event_Observer $observer
|
19 |
*/
|
20 |
-
public function doRedirects(Varien_Event_Observer $observer)
|
|
|
21 |
$request = $observer->getEvent()->getControllerAction()->getRequest();
|
22 |
-
|
23 |
$actionName = $request->getActionName();
|
24 |
$requestUrl = rtrim($request->getScheme() . '://' . $request->getHttpHost() . $request->getRequestUri(), '/');
|
25 |
|
26 |
if ($actionName == 'noRoute') {
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
29 |
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
|
|
33 |
$sourceUrl = rtrim(trim($sourceDestination[0]), '/');
|
|
|
|
|
34 |
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
if ($sourceUrl == $requestUrl) {
|
39 |
-
$
|
40 |
-
|
41 |
-
$
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
}
|
44 |
continue;
|
45 |
}
|
@@ -48,4 +144,4 @@ class Optimiseweb_Redirects_Model_Redirector {
|
|
48 |
}
|
49 |
}
|
50 |
|
51 |
-
}
|
8 |
* @copyright Copyright (c) 2013 Optimise Web Limited
|
9 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
*/
|
11 |
+
class Optimiseweb_Redirects_Model_Redirector
|
12 |
+
{
|
13 |
|
14 |
/**
|
15 |
* Redirect Function
|
18 |
*
|
19 |
* @param Varien_Event_Observer $observer
|
20 |
*/
|
21 |
+
public function doRedirects(Varien_Event_Observer $observer)
|
22 |
+
{
|
23 |
$request = $observer->getEvent()->getControllerAction()->getRequest();
|
|
|
24 |
$actionName = $request->getActionName();
|
25 |
$requestUrl = rtrim($request->getScheme() . '://' . $request->getHttpHost() . $request->getRequestUri(), '/');
|
26 |
|
27 |
if ($actionName == 'noRoute') {
|
28 |
+
$this->doRedirectsLegacy($requestUrl);
|
29 |
+
$this->doRedirects1($requestUrl);
|
30 |
+
$this->doQueryStringRedirects($requestUrl);
|
31 |
+
}
|
32 |
+
return;
|
33 |
+
}
|
34 |
|
35 |
+
protected function doRedirectsLegacy($requestUrl)
|
36 |
+
{
|
37 |
+
if (Mage::getStoreConfig('optimisewebredirects/general/upload') AND file_exists(Mage::getBaseDir('media') . '/optimiseweb/redirects/' . Mage::getStoreConfig('optimisewebredirects/general/upload'))) {
|
38 |
+
|
39 |
+
$redirectLines = file(Mage::getBaseDir('media') . '/optimiseweb/redirects/' . Mage::getStoreConfig('optimisewebredirects/general/upload'));
|
40 |
+
|
41 |
+
foreach ($redirectLines AS $redirectLine) {
|
42 |
+
|
43 |
+
$sourceDestination = explode(';', $redirectLine);
|
44 |
+
|
45 |
+
if (count($sourceDestination) == 2) {
|
46 |
+
$sourceUrl = rtrim(trim($sourceDestination[0]), '/');
|
47 |
+
$destinationUrl = trim($sourceDestination[1]);
|
48 |
+
|
49 |
+
if ($sourceUrl == $requestUrl) {
|
50 |
+
$response = Mage::app()->getResponse();
|
51 |
+
$response->setRedirect($destinationUrl, 301);
|
52 |
+
$response->sendResponse();
|
53 |
+
exit;
|
54 |
+
}
|
55 |
+
continue;
|
56 |
+
}
|
57 |
+
}
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
protected function doRedirects1($requestUrl)
|
62 |
+
{
|
63 |
+
if (Mage::getStoreConfig('optimisewebredirects/redirects1/upload') AND file_exists(Mage::getBaseDir('media') . '/optimiseweb/redirects/' . Mage::getStoreConfig('optimisewebredirects/redirects1/upload'))) {
|
64 |
+
|
65 |
+
$redirectLines = file(Mage::getBaseDir('media') . '/optimiseweb/redirects/' . Mage::getStoreConfig('optimisewebredirects/redirects1/upload'));
|
66 |
+
|
67 |
+
foreach ($redirectLines AS $redirectLine) {
|
68 |
+
|
69 |
+
$sourceDestination = explode(Mage::getStoreConfig('optimisewebredirects/redirects1/delimiter'), $redirectLine);
|
70 |
|
71 |
+
if (count($sourceDestination) == 3) {
|
72 |
$sourceUrl = rtrim(trim($sourceDestination[0]), '/');
|
73 |
+
$destinationUrl = trim($sourceDestination[1]);
|
74 |
+
$redirectCode = (int) trim($sourceDestination[2]);
|
75 |
|
76 |
+
$doRedirect = FALSE;
|
77 |
+
|
78 |
+
if ($sourceUrl == $requestUrl) {
|
79 |
+
$doRedirect = TRUE;
|
80 |
+
} elseif (strpos($sourceUrl, Mage::getStoreConfig('optimisewebredirects/redirects1/wildcardcharacter'))) {
|
81 |
+
$sourceUrl = str_replace(Mage::getStoreConfig('optimisewebredirects/redirects1/wildcardcharacter'), '', $sourceUrl);
|
82 |
+
if (strpos($requestUrl, $sourceUrl) === 0) {
|
83 |
+
$doRedirect = TRUE;
|
84 |
+
}
|
85 |
+
}
|
86 |
+
if ($doRedirect) {
|
87 |
+
$response = Mage::app()->getResponse();
|
88 |
+
$response->setRedirect($destinationUrl, $redirectCode);
|
89 |
+
$response->sendResponse();
|
90 |
+
exit;
|
91 |
+
}
|
92 |
+
continue;
|
93 |
+
}
|
94 |
+
}
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
protected function doQueryStringRedirects($requestUrl)
|
99 |
+
{
|
100 |
+
if (Mage::getStoreConfig('optimisewebredirects/querystring/upload') AND file_exists(Mage::getBaseDir('media') . '/optimiseweb/redirects/' . Mage::getStoreConfig('optimisewebredirects/querystring/upload'))) {
|
101 |
+
|
102 |
+
$query = parse_url($requestUrl);
|
103 |
+
$queryUrl = $query['scheme'] . '://' . $query['host'] . $query['path'];
|
104 |
+
$requestUrl = rtrim($queryUrl, '/');
|
105 |
+
parse_str($query['query'], $queryParts);
|
106 |
+
|
107 |
+
if (is_array($queryParts)) {
|
108 |
+
|
109 |
+
$redirectLines = file(Mage::getBaseDir('media') . '/optimiseweb/redirects/' . Mage::getStoreConfig('optimisewebredirects/querystring/upload'));
|
110 |
+
|
111 |
+
foreach ($redirectLines AS $redirectLine) {
|
112 |
+
|
113 |
+
$queryVarDestination = explode(Mage::getStoreConfig('optimisewebredirects/querystring/delimiter'), $redirectLine);
|
114 |
+
|
115 |
+
if (count($queryVarDestination) == 5) {
|
116 |
+
$sourceUrl = rtrim(trim($queryVarDestination[0]), '/');
|
117 |
+
$queryVar = trim($queryVarDestination[1]);
|
118 |
+
$queryValue = trim($queryVarDestination[2]);
|
119 |
+
$destinationUrl = trim($queryVarDestination[3]);
|
120 |
+
$redirectCode = (int) trim($queryVarDestination[4]);
|
121 |
+
|
122 |
+
$doRedirect = FALSE;
|
123 |
|
124 |
if ($sourceUrl == $requestUrl) {
|
125 |
+
$doRedirect = TRUE;
|
126 |
+
} elseif (strpos($sourceUrl, Mage::getStoreConfig('optimisewebredirects/querystring/wildcardcharacter'))) {
|
127 |
+
$sourceUrl = str_replace(Mage::getStoreConfig('optimisewebredirects/querystring/wildcardcharacter'), '', $sourceUrl);
|
128 |
+
if (strpos($requestUrl, $sourceUrl) === 0) {
|
129 |
+
$doRedirect = TRUE;
|
130 |
+
}
|
131 |
+
}
|
132 |
+
if ($doRedirect) {
|
133 |
+
if (array_key_exists($queryVar, $queryParts) AND ($queryParts[$queryVar] == $queryValue)) {
|
134 |
+
$response = Mage::app()->getResponse();
|
135 |
+
$response->setRedirect($destinationUrl, $redirectCode);
|
136 |
+
$response->sendResponse();
|
137 |
+
exit;
|
138 |
+
}
|
139 |
}
|
140 |
continue;
|
141 |
}
|
144 |
}
|
145 |
}
|
146 |
|
147 |
+
}
|
app/code/community/Optimiseweb/Redirects/etc/adminhtml.xml
CHANGED
@@ -8,39 +8,39 @@
|
|
8 |
*/
|
9 |
-->
|
10 |
<config>
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
<children>
|
18 |
-
<optimiseweball translate="title" module="ow_redirects">
|
19 |
-
<title>Optimise Web - Menu Group</title>
|
20 |
-
<sort_order>10</sort_order>
|
21 |
-
<children>
|
22 |
-
<ow_redirects translate="title" module="ow_redirects">
|
23 |
-
<title>Optimise Web - Mass 301 Redirects</title>
|
24 |
-
<sort_order>10</sort_order>
|
25 |
-
</ow_redirects>
|
26 |
-
</children>
|
27 |
-
</optimiseweball>
|
28 |
-
<system>
|
29 |
-
<children>
|
30 |
-
<config>
|
31 |
<children>
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
</children>
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
</children>
|
43 |
-
</admin>
|
44 |
-
</resources>
|
45 |
-
</acl>
|
46 |
</config>
|
8 |
*/
|
9 |
-->
|
10 |
<config>
|
11 |
+
<acl>
|
12 |
+
<resources>
|
13 |
+
<all>
|
14 |
+
<title>Allow Everything</title>
|
15 |
+
</all>
|
16 |
+
<admin>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
<children>
|
18 |
+
<optimiseweball translate="title" module="ow_redirects">
|
19 |
+
<title>Optimise Web - Menu Group</title>
|
20 |
+
<sort_order>10</sort_order>
|
21 |
+
<children>
|
22 |
+
<ow_redirects translate="title" module="ow_redirects">
|
23 |
+
<title>Optimise Web - Mass 301 Redirects</title>
|
24 |
+
<sort_order>10</sort_order>
|
25 |
+
</ow_redirects>
|
26 |
+
</children>
|
27 |
+
</optimiseweball>
|
28 |
+
<system>
|
29 |
+
<children>
|
30 |
+
<config>
|
31 |
+
<children>
|
32 |
+
<optimisewebconfig translate="title" module="ow_redirects">
|
33 |
+
<title>Optimise Web - System Configuration Group</title>
|
34 |
+
</optimisewebconfig>
|
35 |
+
<optimisewebredirects translate="title" module="ow_redirects">
|
36 |
+
<title>Optimise Web - Mass 301 Redirects</title>
|
37 |
+
</optimisewebredirects>
|
38 |
+
</children>
|
39 |
+
</config>
|
40 |
+
</children>
|
41 |
+
</system>
|
42 |
</children>
|
43 |
+
</admin>
|
44 |
+
</resources>
|
45 |
+
</acl>
|
|
|
|
|
|
|
|
|
46 |
</config>
|
app/code/community/Optimiseweb/Redirects/etc/config.xml
CHANGED
@@ -1,70 +1,97 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* @package Optimiseweb_Redirects
|
5 |
-
* @author Kathir Vel (sid@optimiseweb.co.uk)
|
6 |
-
* @copyright Copyright (c) 2013 Optimise Web Limited
|
7 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
-
*/
|
9 |
-
-->
|
10 |
-
<config>
|
11 |
-
|
12 |
-
<modules>
|
13 |
-
<Optimiseweb_Redirects>
|
14 |
-
<version>0.1.
|
15 |
-
</Optimiseweb_Redirects>
|
16 |
-
</modules>
|
17 |
-
|
18 |
-
<frontend>
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
<
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
</frontend>
|
31 |
-
|
32 |
-
<adminhtml>
|
33 |
-
<menu>
|
34 |
-
<optimiseweball translate="title" module="ow_redirects">
|
35 |
-
<title>Optimise Web</title>
|
36 |
-
<sort_order>71</sort_order>
|
37 |
-
<children>
|
38 |
-
<ow_redirects translate="title" module="ow_redirects">
|
39 |
-
<title>Mass 301 Redirects</title>
|
40 |
-
<sort_order>5</sort_order>
|
41 |
-
<action>adminhtml/system_config/edit/section/optimisewebredirects</action>
|
42 |
-
</ow_redirects>
|
43 |
-
</children>
|
44 |
-
</optimiseweball>
|
45 |
-
</menu>
|
46 |
-
</adminhtml>
|
47 |
-
|
48 |
-
<global>
|
49 |
-
|
50 |
-
<blocks>
|
51 |
-
<ow_redirects>
|
52 |
-
<class>Optimiseweb_Redirects_Block</class>
|
53 |
-
</ow_redirects>
|
54 |
-
</blocks>
|
55 |
-
|
56 |
-
<helpers>
|
57 |
-
<ow_redirects>
|
58 |
-
<class>Optimiseweb_Redirects_Helper</class>
|
59 |
-
</ow_redirects>
|
60 |
-
</helpers>
|
61 |
-
|
62 |
-
<models>
|
63 |
-
<ow_redirects>
|
64 |
-
<class>Optimiseweb_Redirects_Model</class>
|
65 |
-
</ow_redirects>
|
66 |
-
</models>
|
67 |
-
|
68 |
-
|
69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
</config>
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @package Optimiseweb_Redirects
|
5 |
+
* @author Kathir Vel (sid@optimiseweb.co.uk)
|
6 |
+
* @copyright Copyright (c) 2013 Optimise Web Limited
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<config>
|
11 |
+
|
12 |
+
<modules>
|
13 |
+
<Optimiseweb_Redirects>
|
14 |
+
<version>0.1.7</version>
|
15 |
+
</Optimiseweb_Redirects>
|
16 |
+
</modules>
|
17 |
+
|
18 |
+
<frontend>
|
19 |
+
|
20 |
+
<translate>
|
21 |
+
<modules>
|
22 |
+
<Optimiseweb_Redirects>
|
23 |
+
<files>
|
24 |
+
<default>Optimiseweb_Redirects.csv</default>
|
25 |
+
</files>
|
26 |
+
</Optimiseweb_Redirects>
|
27 |
+
</modules>
|
28 |
+
</translate>
|
29 |
+
|
30 |
+
</frontend>
|
31 |
+
|
32 |
+
<adminhtml>
|
33 |
+
<menu>
|
34 |
+
<optimiseweball translate="title" module="ow_redirects">
|
35 |
+
<title>Optimise Web</title>
|
36 |
+
<sort_order>71</sort_order>
|
37 |
+
<children>
|
38 |
+
<ow_redirects translate="title" module="ow_redirects">
|
39 |
+
<title>Mass 301 Redirects</title>
|
40 |
+
<sort_order>5</sort_order>
|
41 |
+
<action>adminhtml/system_config/edit/section/optimisewebredirects</action>
|
42 |
+
</ow_redirects>
|
43 |
+
</children>
|
44 |
+
</optimiseweball>
|
45 |
+
</menu>
|
46 |
+
</adminhtml>
|
47 |
+
|
48 |
+
<global>
|
49 |
+
|
50 |
+
<blocks>
|
51 |
+
<ow_redirects>
|
52 |
+
<class>Optimiseweb_Redirects_Block</class>
|
53 |
+
</ow_redirects>
|
54 |
+
</blocks>
|
55 |
+
|
56 |
+
<helpers>
|
57 |
+
<ow_redirects>
|
58 |
+
<class>Optimiseweb_Redirects_Helper</class>
|
59 |
+
</ow_redirects>
|
60 |
+
</helpers>
|
61 |
+
|
62 |
+
<models>
|
63 |
+
<ow_redirects>
|
64 |
+
<class>Optimiseweb_Redirects_Model</class>
|
65 |
+
</ow_redirects>
|
66 |
+
</models>
|
67 |
+
|
68 |
+
<events>
|
69 |
+
<controller_action_predispatch>
|
70 |
+
<observers>
|
71 |
+
<optimiseweb_redirects_model_redirector>
|
72 |
+
<type>singleton</type>
|
73 |
+
<class>ow_redirects/redirector</class>
|
74 |
+
<method>doRedirects</method>
|
75 |
+
</optimiseweb_redirects_model_redirector>
|
76 |
+
</observers>
|
77 |
+
</controller_action_predispatch>
|
78 |
+
</events>
|
79 |
+
|
80 |
+
</global>
|
81 |
+
|
82 |
+
<default>
|
83 |
+
|
84 |
+
<optimisewebredirects>
|
85 |
+
<redirects1>
|
86 |
+
<delimiter>,</delimiter>
|
87 |
+
<wildcardcharacter>*</wildcardcharacter>
|
88 |
+
</redirects1>
|
89 |
+
<querystring>
|
90 |
+
<delimiter>,</delimiter>
|
91 |
+
<wildcardcharacter>*</wildcardcharacter>
|
92 |
+
</querystring>
|
93 |
+
</optimisewebredirects>
|
94 |
+
|
95 |
+
</default>
|
96 |
+
|
97 |
</config>
|
app/code/community/Optimiseweb/Redirects/etc/system.xml
CHANGED
@@ -9,58 +9,158 @@
|
|
9 |
-->
|
10 |
<config>
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
</config>
|
9 |
-->
|
10 |
<config>
|
11 |
|
12 |
+
<tabs>
|
13 |
+
<optimisewebconfig translate="label comment" module="ow_redirects">
|
14 |
+
<label>Optimise Web</label>
|
15 |
+
<sort_order>0</sort_order>
|
16 |
+
</optimisewebconfig>
|
17 |
+
</tabs>
|
18 |
|
19 |
+
<sections>
|
20 |
+
<optimisewebredirects translate="label comment" module="ow_redirects">
|
21 |
+
<label>Mass 301 Redirects</label>
|
22 |
+
<tab>optimisewebconfig</tab>
|
23 |
+
<frontend_type>text</frontend_type>
|
24 |
+
<sort_order>99999</sort_order>
|
25 |
+
<show_in_default>1</show_in_default>
|
26 |
+
<show_in_website>1</show_in_website>
|
27 |
+
<show_in_store>1</show_in_store>
|
28 |
+
<groups>
|
29 |
|
30 |
+
<general translate="label comment" module="ow_redirects">
|
31 |
+
<label>Legacy - Upload / Download CSV File</label>
|
32 |
+
<frontend_type>text</frontend_type>
|
33 |
+
<sort_order>2</sort_order>
|
34 |
+
<show_in_default>1</show_in_default>
|
35 |
+
<show_in_website>1</show_in_website>
|
36 |
+
<show_in_store>1</show_in_store>
|
37 |
+
<fields>
|
38 |
+
<upload translate="label comment" module="ow_redirects">
|
39 |
+
<label>Upload Redirects File</label>
|
40 |
+
<comment>If you have already uploaded a CSV file and wish to add or edit the URLs, please download the current CSV file and reupload that file after making the changes.</comment>
|
41 |
+
<frontend_type>file</frontend_type>
|
42 |
+
<backend_model>adminhtml/system_config_backend_file</backend_model>
|
43 |
+
<upload_dir config="system/filesystem/media" scope_info="1">optimiseweb/redirects</upload_dir>
|
44 |
+
<base_url type="media" scope_info="1">optimiseweb/redirects</base_url>
|
45 |
+
<sort_order>1</sort_order>
|
46 |
+
<show_in_default>1</show_in_default>
|
47 |
+
<show_in_website>1</show_in_website>
|
48 |
+
<show_in_store>1</show_in_store>
|
49 |
+
</upload>
|
50 |
+
<download translate="label comment" module="ow_redirects">
|
51 |
+
<label>Download Redirects File</label>
|
52 |
+
<comment>Right click on this link and click on 'Save Link As...'</comment>
|
53 |
+
<frontend_model>ow_redirects/system_config_backend_download</frontend_model>
|
54 |
+
<sort_order>2</sort_order>
|
55 |
+
<show_in_default>1</show_in_default>
|
56 |
+
<show_in_website>1</show_in_website>
|
57 |
+
<show_in_store>1</show_in_store>
|
58 |
+
</download>
|
59 |
+
</fields>
|
60 |
+
</general>
|
61 |
|
62 |
+
<redirects1 translate="label comment" module="ow_redirects">
|
63 |
+
<label>Redirects System v1.0</label>
|
64 |
+
<frontend_type>text</frontend_type>
|
65 |
+
<sort_order>3</sort_order>
|
66 |
+
<show_in_default>1</show_in_default>
|
67 |
+
<show_in_website>1</show_in_website>
|
68 |
+
<show_in_store>1</show_in_store>
|
69 |
+
<fields>
|
70 |
+
<upload translate="label comment" module="ow_redirects">
|
71 |
+
<label>Upload Redirects File</label>
|
72 |
+
<comment>If you have already uploaded a CSV file and wish to add or edit the URLs, please download the current CSV file and reupload that file after making the changes.</comment>
|
73 |
+
<frontend_type>file</frontend_type>
|
74 |
+
<backend_model>adminhtml/system_config_backend_file</backend_model>
|
75 |
+
<upload_dir config="system/filesystem/media" scope_info="1">optimiseweb/redirects</upload_dir>
|
76 |
+
<base_url type="media" scope_info="1">optimiseweb/redirects</base_url>
|
77 |
+
<sort_order>1</sort_order>
|
78 |
+
<show_in_default>1</show_in_default>
|
79 |
+
<show_in_website>1</show_in_website>
|
80 |
+
<show_in_store>1</show_in_store>
|
81 |
+
</upload>
|
82 |
+
<download translate="label comment" module="ow_redirects">
|
83 |
+
<label>Download Redirects File</label>
|
84 |
+
<comment>Right click on this link and click on 'Save Link As...'</comment>
|
85 |
+
<frontend_model>ow_redirects/system_config_backend_download1</frontend_model>
|
86 |
+
<sort_order>2</sort_order>
|
87 |
+
<show_in_default>1</show_in_default>
|
88 |
+
<show_in_website>1</show_in_website>
|
89 |
+
<show_in_store>1</show_in_store>
|
90 |
+
</download>
|
91 |
+
<delimiter translate="label comment" module="ow_redirects">
|
92 |
+
<label>Delimiter</label>
|
93 |
+
<comment>Defaults to comma (,). Depends on how you save your CSV file.</comment>
|
94 |
+
<frontend_type>text</frontend_type>
|
95 |
+
<sort_order>3</sort_order>
|
96 |
+
<show_in_default>1</show_in_default>
|
97 |
+
<show_in_website>1</show_in_website>
|
98 |
+
<show_in_store>1</show_in_store>
|
99 |
+
</delimiter>
|
100 |
+
<wildcardcharacter translate="label comment" module="ow_redirects">
|
101 |
+
<label>Wildcard Character</label>
|
102 |
+
<comment>Defaults to asterisk (*).</comment>
|
103 |
+
<frontend_type>text</frontend_type>
|
104 |
+
<sort_order>4</sort_order>
|
105 |
+
<show_in_default>1</show_in_default>
|
106 |
+
<show_in_website>1</show_in_website>
|
107 |
+
<show_in_store>1</show_in_store>
|
108 |
+
</wildcardcharacter>
|
109 |
+
</fields>
|
110 |
+
</redirects1>
|
111 |
+
|
112 |
+
<querystring translate="label comment" module="ow_redirects">
|
113 |
+
<label>Query String Based Redirects</label>
|
114 |
+
<frontend_type>text</frontend_type>
|
115 |
+
<sort_order>4</sort_order>
|
116 |
+
<show_in_default>1</show_in_default>
|
117 |
+
<show_in_website>1</show_in_website>
|
118 |
+
<show_in_store>1</show_in_store>
|
119 |
+
<fields>
|
120 |
+
<upload translate="label comment" module="ow_redirects">
|
121 |
+
<label>Upload Redirects File</label>
|
122 |
+
<comment>If you have already uploaded a CSV file and wish to add or edit the URLs, please download the current CSV file and reupload that file after making the changes.</comment>
|
123 |
+
<frontend_type>file</frontend_type>
|
124 |
+
<backend_model>adminhtml/system_config_backend_file</backend_model>
|
125 |
+
<upload_dir config="system/filesystem/media" scope_info="1">optimiseweb/redirects</upload_dir>
|
126 |
+
<base_url type="media" scope_info="1">optimiseweb/redirects</base_url>
|
127 |
+
<sort_order>1</sort_order>
|
128 |
+
<show_in_default>1</show_in_default>
|
129 |
+
<show_in_website>1</show_in_website>
|
130 |
+
<show_in_store>1</show_in_store>
|
131 |
+
</upload>
|
132 |
+
<download translate="label comment" module="ow_redirects">
|
133 |
+
<label>Download Redirects File</label>
|
134 |
+
<comment>Right click on this link and click on 'Save Link As...'</comment>
|
135 |
+
<frontend_model>ow_redirects/system_config_backend_downloadquerystringfile</frontend_model>
|
136 |
+
<sort_order>2</sort_order>
|
137 |
+
<show_in_default>1</show_in_default>
|
138 |
+
<show_in_website>1</show_in_website>
|
139 |
+
<show_in_store>1</show_in_store>
|
140 |
+
</download>
|
141 |
+
<delimiter translate="label comment" module="ow_redirects">
|
142 |
+
<label>Delimiter</label>
|
143 |
+
<comment>Defaults to comma (,). Depends on how you save your CSV file.</comment>
|
144 |
+
<frontend_type>text</frontend_type>
|
145 |
+
<sort_order>3</sort_order>
|
146 |
+
<show_in_default>1</show_in_default>
|
147 |
+
<show_in_website>1</show_in_website>
|
148 |
+
<show_in_store>1</show_in_store>
|
149 |
+
</delimiter>
|
150 |
+
<wildcardcharacter translate="label comment" module="ow_redirects">
|
151 |
+
<label>Wildcard Character</label>
|
152 |
+
<comment>Defaults to asterisk (*).</comment>
|
153 |
+
<frontend_type>text</frontend_type>
|
154 |
+
<sort_order>4</sort_order>
|
155 |
+
<show_in_default>1</show_in_default>
|
156 |
+
<show_in_website>1</show_in_website>
|
157 |
+
<show_in_store>1</show_in_store>
|
158 |
+
</wildcardcharacter>
|
159 |
+
</fields>
|
160 |
+
</querystring>
|
161 |
+
|
162 |
+
</groups>
|
163 |
+
</optimisewebredirects>
|
164 |
+
</sections>
|
165 |
|
166 |
</config>
|
app/locale/en_US/Optimiseweb_Redirects.csv
ADDED
File without changes
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Optimiseweb_Redirects</name>
|
4 |
-
<version>0.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
@@ -10,11 +10,14 @@
|
|
10 |
<description>Magento has an internal URL Rewrite Management system. It can be a laborious task to add all your redirects, one by one.
|
11 |

|
12 |
The Optimise Web Redirects extension allows you to upload all your redirect data as a CSV file.</description>
|
13 |
-
<notes>
|
|
|
|
|
|
|
14 |
<authors><author><name>Kathir Vel</name><user>OptimiseWeb</user><email>info@optimiseweb.co.uk</email></author></authors>
|
15 |
-
<date>2013-07
|
16 |
-
<time>
|
17 |
-
<contents><target name="magecommunity"><dir name="Optimiseweb"><dir name="Redirects"><dir name="Block"><dir name="System"><dir name="Config"><dir name="Backend"><file name="Download.php" hash="
|
18 |
<compatible/>
|
19 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
20 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Optimiseweb_Redirects</name>
|
4 |
+
<version>0.1.7</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>
|
10 |
<description>Magento has an internal URL Rewrite Management system. It can be a laborious task to add all your redirects, one by one.
|
11 |

|
12 |
The Optimise Web Redirects extension allows you to upload all your redirect data as a CSV file.</description>
|
13 |
+
<notes>New update with two new features.
|
14 |
+
* Improved CSV file support
|
15 |
+
* Ability to provide query string based redirects
|
16 |
+
* Old CSV will still work as the first option</notes>
|
17 |
<authors><author><name>Kathir Vel</name><user>OptimiseWeb</user><email>info@optimiseweb.co.uk</email></author></authors>
|
18 |
+
<date>2013-11-07</date>
|
19 |
+
<time>14:32:37</time>
|
20 |
+
<contents><target name="magecommunity"><dir name="Optimiseweb"><dir name="Redirects"><dir name="Block"><dir name="System"><dir name="Config"><dir name="Backend"><file name="Download.php" hash="76e64a0957fe7df052760ffa850abaad"/><file name="Download1.php" hash="3962f8bebc085630a22989cbc0c8502a"/><file name="Downloadquerystringfile.php" hash="610be4937f16577f8a6588bd8c6c978c"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="ef4e86f64b9f046a5ccb79b1111e1927"/></dir><dir name="Model"><file name="Redirector.php" hash="6b43bda3e79fa328222fb057c808ffe0"/></dir><dir name="etc"><file name="adminhtml.xml" hash="22de1e5ccbd05fd303d8a09c1682d698"/><file name="config.xml" hash="eadf123a259eac38d3f1ccf8218f36f2"/><file name="system.xml" hash="0918c53b9070c2b42ad68f7209956019"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Optimiseweb_Redirects.xml" hash="455126831539cd3afc0aab1125bf41e5"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Optimiseweb_Redirects.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></target></contents>
|
21 |
<compatible/>
|
22 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
23 |
</package>
|