How Can I optimize this RewriteEngine Code?
- by Lucki Mile
I have server overload, server admin said that this issue is caused from htaccess file
This is the code:
RewriteEngine On
RewriteBase /here/
RewriteRule ^top/?$ index.php?mode=top [QSA]
RewriteRule ^top/video/?$ index.php?mode=top&cat=vids [QSA]
RewriteRule ^top/picture/?$ /index.php?mode=top&cat=pics [QSA]
RewriteRule ^random$ index.php?mode=random [QSA]
RewriteRule ^random/video/?$ index.php?mode=random&cat=vids [QSA]
RewriteRule ^random/picture/?$ index.php?mode=random&cat=pics [QSA]
RewriteRule ^new/?$ index.php [QSA]
RewriteRule ^new/video/?$ index.php?mode=&cat=vids [QSA]
RewriteRule ^new/picture/?$ index.php?mode=&cat=pics [QSA]
RewriteRule ^video/([0-9]+)_(.*)$ item.php?cat=vids&id=$1 [QSA]
RewriteRule ^picture/([0-9]+)_(.*)$ item.php?cat=pics&id=$1 [QSA]
ErrorDocument 404 /item.php