Daniyaal Khan
Daniyaal Khan

Reputation: 71

Website too slow after using htaccess rewrite rules

I recently added a couple rewrite rules and since then my site has been too slow. What will be a more efficient way to use these rewrite rules:

RewriteRule ^videos/([0-9a-zA-Z-]+)$ videos.php?var=$1 [NC,L]
RewriteRule ^article/([0-9a-zA-Z-]+)$ article.php?var=$1 [NC,L]
RewriteRule ^video/([0-9a-zA-Z-]+)$ video.php?var=$1 [NC,L]

Thanks in advance!

Upvotes: 0

Views: 1288

Answers (1)

Chris du Preez
Chris du Preez

Reputation: 539

Not completely sure if this will solve your problem but there is a "known" performance degredation by using .htaccess for rewrites as stated in Apache's documentation

You should avoid using .htaccess files completely if you have access to httpd main server config file. Using .htaccess files slows down your Apache server. Any directive that you can include in a .htaccess file is better set in a Directory block, as it will have the same effect with better performance.

Hope this helps.

Upvotes: 2

Related Questions