Rewrite all the tabe url to alais

In brief, this project could help you rewrite the URLs.

1. sub urls of node and user will be rewritten when the parent url has an alias.
2. you can use regex to rewrite any url if you want

NOTICE: no need to enable this module, just include the core in your settings.php

In Drupal, we have node and user. In many cases, node|user has many sub-tab menu, such as node/%/info node/%/devel and any other MENU_LOCAL_TASK.
If you use url_alias, you need to add alias for each of them. This module, Rewrite Sub Link, will help you rewrite them automatically, and which doesn't user url_alias, so when you have millions of node, it won't case a performance issue.

Additionally, this module support regular express, so you can write your regular express to change your URL.

Light-weight Usage
add this line in the settings.php file,
include_once "sites/all/modules/contrib/rewrite_sub_link/rewrite_sub_link.core.inc";
add your custom settings in your settings.php
include_once "path_to_your_custom_rewrite_settings.php"
or change the code in rewrite_sub_link/rewrite_settings.php directly.

then all the sub links of user and node will be rewritten automatically.
Please check rewrite_settings.php file and change for your custom settings.

NOTICE
This module is using code as settings, and didn't save many settings in Drupal db as Drupal way. Since url_rewrite function is called by everywhere in drupal core, so the performance is very important.

Similar projects
URL alter Inbound URL has problem, since it didn't include the file before module loading.
Galaxy Url Rewrite Not automatically support sub tab menu, you need to set url manually which save into db. Neither does 'Galaxy Url Rewrite' support Regular Express.

[Chinese]
模块主要作用
不用alias来重写Drupal的URL

1. 重写node或user的子URL
比如 node/%/info user/%/info
2. 支持正则表达式重写URL
正则表达式支持自定义函数

模块使用方法
在settings.php最后面加上下面的代码(注意修改路径)
include_once "sites/all/modules/contrib/rewrite_sub_link/rewrite_sub_link.core.inc";

(可选)然后可以修改模块下面的rewrite_settings.php,如果不想修改模块代码,可以在settings.php里面再include进来自定义的settings文件。

Powered by 广州Drupal开发 | Drupal 与高性能网站架构

Project Information

Downloads