Post by aleopencart » Sat Oct 22, 2016 4:47 pm

1) In your back-end Store -> Settings -> Edit your Store -> Server TAB flag 'yes' the option 'Use SEO URLs'

2) Save follow code in a file named 'oc_url_alias.sql' and import it with PhpMyAdmin in your db store.
(if you have other prefix table, change "oc_" with your table prefix)

Code: Select all

INSERT INTO `oc_url_alias` (`query`, `keyword`) VALUES
('common/home', ''),
('account/wishlist', 'wishlist'),
('account/account', 'my-account'),
('checkout/cart', 'shopping-cart'),
('checkout/checkout', 'checkout'),
('account/login', 'login'),
('account/logout', 'logout'),
('account/order', 'order-history'),
('account/newsletter', 'newsletter'),
('product/special', 'specials'),
('affiliate/account', 'affiliates'),
('checkout/voucher', 'gift-vouchers'),
('product/manufacturer', 'brands'),
('information/contact', 'contact-us'),
('account/return/insert', 'request-return'),
('information/sitemap', 'sitemapprova'),
('account/forgotten', 'forgot-password'),
('account/download', 'downloads'),
('account/return', 'returns'),
('account/transaction', 'transactions'),
('account/register', 'create-account'),
('product/compare', 'compare-products'),
('product/search', 'search'),
('account/edit', 'edit-account'),
('account/password', 'change-password'),
('account/address', 'address-book'),
('account/reward', 'reward-points'),
('affiliate/edit', 'edit-affiliate-account'),
('affiliate/password', 'change-affiliate-password'),
('affiliate/payment', 'affiliate-payment-options'),
('affiliate/tracking', 'affiliate-tracking-code'),
('affiliate/transaction', 'affiliate-transactions'),
('affiliate/logout', 'affiliate-logout'),
('affiliate/forgotten', 'affiliate-forgot-password'),
('affiliate/register', 'create-affiliate-account'),
('affiliate/login', 'affiliate-login');
That's all

User avatar
New member

Posts

Joined
Tue Jul 12, 2016 11:57 pm

Post by muhittinemmi » Sun Aug 29, 2021 2:41 pm

After doing these

http://www.domainname.com/login
What changes do we need to make in the catalog/controller/startup/seo_url.php file.

New member

Posts

Joined
Wed Aug 25, 2021 3:46 am

Post by straightlight » Sun Aug 29, 2021 6:22 pm

OC version. No changes required after adding this table.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by muhittinemmi » Sun Aug 29, 2021 11:01 pm

straightlight wrote:
Sun Aug 29, 2021 6:22 pm
OC version. No changes required after adding this table.
I am using Opencart version 2.3.0.2.

I added the table

there was no change
https://domain.com/index.php?route=account/login

New member

Posts

Joined
Wed Aug 25, 2021 3:46 am

Post by straightlight » Sun Aug 29, 2021 11:43 pm

Did you enabled .htaccess?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by muhittinemmi » Mon Aug 30, 2021 5:07 am

straightlight wrote:
Sun Aug 29, 2021 11:43 pm
Did you enabled .htaccess?
.htaccess?enabled
only system page SEO URL not working

New member

Posts

Joined
Wed Aug 25, 2021 3:46 am

Post by straightlight » Mon Aug 30, 2021 8:24 am

muhittinemmi wrote:
Mon Aug 30, 2021 5:07 am
straightlight wrote:
Sun Aug 29, 2021 11:43 pm
Did you enabled .htaccess?
.htaccess?enabled
only system page SEO URL not working
Please post your .htaccess file, config.php and admin/config.php files (without database password information).

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by muhittinemmi » Mon Aug 30, 2021 1:48 pm

straightlight wrote:
Mon Aug 30, 2021 8:24 am
muhittinemmi wrote:
Mon Aug 30, 2021 5:07 am
straightlight wrote:
Sun Aug 29, 2021 11:43 pm
Did you enabled .htaccess?
.htaccess?enabled
only system page SEO URL not working
Please post your .htaccess file, config.php and admin/config.php files (without database password information).
Hi!

catalog/controller/startup/seo_url.php

Code: Select all

unset($data[$key]);

				} elseif ($key == 'path') {
					$categories = explode('_', $value);

					foreach ($categories as $category) {
						$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "url_alias WHERE `query` = 'category_id=" . (int)$category . "'");

						if ($query->num_rows && $query->row['keyword']) {
							$url .= '/' . $query->row['keyword'];
						} else {
							$url = '';

							break;
						}
					}

					unset($data[$key]);

I added the following code at the top

Code: Select all


unset($data[$key]);
				} elseif (isset($data['route']) && $data['route'] != 'information/information/agree') { // new code start
					$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "url_alias WHERE `query` = '" . $this->db->escape($key . '=' . (int)$value) . "' OR `query` = '" . filter_var($value, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH) . "'");
				
					if ($query->num_rows) {
						$url .= '/' . $query->row['keyword'];
						
						unset($data[$key]);
					}
				} elseif ($data['route'] == 'common/home') {
					$url = '/';
					
					unset($data[$key]);


works flawlessly

http://domainname.com/login

Is what I'm doing right? Do I need to send the files you want?

New member

Posts

Joined
Wed Aug 25, 2021 3:46 am

Post by straightlight » Mon Aug 30, 2021 6:44 pm

If you have to go this far to handle SEOs by default, then clearly you did something wrong from either the three files mentioned above or you're specifically looking for an extension.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 5 guests