Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need help with .htaccess rewrite rule

    Hi codingforums friends,

    I need help with rewrite rule as my website looks not SE friendly now. It is all dynamic URLs and I am unable to figure out how to rewrite it properly.

    This is my website topnamebrands.net

    The links for the brands look like:

    http://www.topnamebrands.net/?filter=%3AGucci%3A

    And the different categories like:

    http://www.topnamebrands.net/?filter=%3AGucci%3ADresses

    And if go deeper is:

    http://www.topnamebrands.net/?product=_id_4766

    What rule to apply to have something that look like:

    topnamebrands.net/Gucci/
    topnamebrands.net/Gucci/dresses/

    this is just an example, it can look different, but similar.

    Thank you for your help!

    Kind regards

    Kal

  • #2
    New Coder
    Join Date
    Jun 2010
    Location
    Enschede, Netherlands
    Posts
    34
    Thanks
    18
    Thanked 0 Times in 0 Posts
    I am not an expert, but this site helped me to write my rules.

    http://www.generateit.net/mod-rewrite/

    make sure yuo first have your links like what you want to be INSIDE your codes.
    ELECTRONICSPUB.COM
    All about electronics and hardware

  • #3
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    Try something like this:
    Code:
    RewriteEngine On
    RewriteCond %{REQUEST_URI} -f
    RewriteCond %{REQUEST_URI} -d
    RewriteRule ^/(.*)$ /?filter=$1 [L]
    You will have to update your script to accept filters with slashes instead of colons in this case, but you can get more specific and tweak it to your liking if that is a problem.

  • #4
    Banned
    Join Date
    Jul 2010
    Posts
    66
    Thanks
    0
    Thanked 1 Time in 1 Post
    Hi To enable mod_rewrite in xampp first go to the directory of installation <xampp-directory>\apache\conf and edit httpd.conf. Find the line which contains
    #LoadModule rewrite_module modules/mod_rewrite.so
    uncomment this(should be):

    LoadModule rewrite_module modules/mod_rewrite.so

    Also find AllowOverride None

    Should be:

    AllowOverride All

    Thanks & Regards
    Santhosh
    I really think it appears 2 times and later restart the apache .....


  •  

    Posting Permissions

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