How to Creating Mod_Rewrites for All the Dynamic Pages?

Discussion in 'Apache' started by bushib, Oct 16, 2007.

  1. #1
    Hi there,

    I want to know that how to create the Mod_Rewrites for all the pages of a dynamic/E-commerce website.

    Where to change in the code for different pages within the .htaccess file?.

    Any help will be highly appreciated.

    Regards
    bushib
     
    bushib, Oct 16, 2007 IP
  2. Ladadadada

    Ladadadada Peon

    Messages:
    382
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Essentially, you will need AllowOverride All in your vhost to allow .htaccess files to work, you will need RewriteEngine On in your .htaccess file and below that you will need some RewriteRules.

    A good one to test that you have done the other steps correctly is:
    RewriteRule test http://google.com [R]
    Code (markup):
    Once you have that in your .htaccess, request http://yourwebsite.com/test and you should be redirected to google.com.

    Following that, you should read the mod_rewrite FAQ and the Apache mod_rewrite regular expressions guide on this forum.

    Between them, they should teach you everything you need to know about creating search-engine friendly URLs. Of course, if you still have any specific questions, feel free to come back and ask. :)
     
    Ladadadada, Oct 17, 2007 IP