SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Oct 2008
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    performance after rewriting url with htaccess file

    Hi, I was thinking of rewriting my url-s on my web page using a .htaccess file, using the RewriteRule function, for SEO reasons.
    For example, I would rewrite my url-s from domain.com/example.php?id=2 to domain.com/example/2 .
    However, I am a bit concerned about the loading speed of my site after using the htaccess file, because I heard that these kind of files really tend to slow down the server... I would probably have around 20-25 rewrite rules altogether.

    Any suggestions?

    Thanks a lot

  2. #2
    SitePoint Addict
    Join Date
    Apr 2011
    Posts
    265
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    My opinion is that the speed will be slow down only with a few milliseconds, and this is not a problem.
    If you can have friendly url for seo, it is better to rewrite the url.
    Free: Web Programming Courses HTML, CSS, Flash
    Web Programming: AJAX Course and PHP-MySQL Course video Lessons
    Good JavaScript and jQuery course for beginners

  3. #3
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,096
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    It has a small impact, but not enough to notice unless you get to a few hundred or even a few thousand rules.
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,672
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    vaj,

    The real power of mod_rewrite is in using the regex engine. That means that your 20 or so redirections would easily be handled by one line of mod_rewrite code (okay, two if you count RewriteEngine on).

    If you're not familiar with regular expressions (or mod_rewrite, for that matter), have a look at the tutorial linked in my signature as it's helped many members over the years.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •