Link to home
Start Free TrialLog in
Avatar of proteam4
proteam4

asked on

Is rewrite using htaccess is slower than folder based URLs?

I am creating URLs in my website as

    http://example.com/register/
   
    http://example.com/login/

I am creating above URLs by writing following rules in htaccess

    RewriteRule register/ /register.php
   
    RewriteRule login/ /login.php

Now its working fine for me, but if I create my URLs by creating seprate folder for `/login/index.php` and `/register/index.php` By creating folders and index.php files inside those I can achieve above functionality easily.

But I want to know which w=one will be faster, I tried both methods but not seen much difference, according to logic and apache specifications and everything which method will be faster and a good method to go with.

My friend says .htaccess rules will be slower, because in case of htaccess first it will check for rules and then it will redirect to the corresponding attached page, this process will take time than folder organization.
Avatar of yfastud
yfastud
Flag of United States of America image

depends on contents of your htaccess and it would take longer time if and only if you have too many rules in 1 htaccess; however, most users would not notice that since it occurs in server before delivery to users ;)
ASKER CERTIFIED SOLUTION
Avatar of pmessana
pmessana

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial