This repository has been archived by the owner on Jan 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Friendly URLs [almost] everywhere! (close #3)
But halt! Further improvement is coming! Some old-fashioned URLs (index.php?module=xxxx&id=x) are still there!! I need to program some patterns to modify the controllers (e.g.: variables like ID, instead of t_id, p_id, m_id, etc).
- Loading branch information
1 parent
f1bb536
commit 99b74e6
Showing
21 changed files
with
107 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<IfModule mod_rewrite.c> | ||
RewriteEngine On | ||
|
||
# AdminCP is... well... admin! Do not rewrite it! | ||
RewriteRule ^(admin|user)($|/) - [L] | ||
|
||
# /logout is not a controller, just a shortcut | ||
RewriteRule ^(logout)$ index.php?module=login&act=logout | ||
RewriteRule ^(logout)/$ index.php?module=login&act=logout | ||
|
||
# /foo = index.php?module=foo | ||
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?module=$1 | ||
RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?module=$1 | ||
|
||
# /foo/2 = index.php?module=foo&id=2 | ||
RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)$ index.php?module=$1&id=$2 | ||
RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)/$ index.php?module=$1&id=$2 | ||
|
||
# /foo/bar = index.php?module=foo&view=bar | ||
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z]+)$ index.php?module=$1&view=$2 | ||
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z]+)/$ index.php?module=$1&view=$2 | ||
|
||
# /foo/2/bar = index.php?module=foo&id=2&act=bar | ||
RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)/([a-zA-Z0-9_-]+)$ index.php?module=$1&id=$2&act=$3 | ||
RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)/([a-zA-Z0-9_-]+)/$ index.php?module=$1&id=$2&act=$3 | ||
|
||
# Thread specific URLs (SEO friendly) | ||
# /thread/1-lorem-ipsum-dolor-sit-amet = index.php?module=thread&id=1 | ||
RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)\-([a-zA-Z0-9-]+)$ index.php?module=$1&id=$2 | ||
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.