Clean URL's using OpenCart's router class

随声附和 提交于 2021-02-19 01:14:36

问题


How do you write clean URL's in OpenCart using their built in Router class? Here is my .htaccess file:

RewriteEngine On
RewriteRule ^(system) - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

回答1:


The work is very hard To modify more than 3 files

catalog\controller\common\seo_url.php
catalog\model\tool\seo_url.php

Add this line to your file to modify

$this->load->model('tool/seo_url') and used $this->model_tool_seo_url->rewrite() to rewrite.

Hard to say clearly,the above are only approximate




回答2:


You can change catalog\controller\common\seo_url.php and use VQMod to add your own lines of code to it. For example, you can create some class in another file and call that class's members in catalog\controller\common\seo_url.php using VQMod.



来源:https://stackoverflow.com/questions/1743049/clean-urls-using-opencarts-router-class

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!