Welcome to Welcome to DNF.com™ - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars

If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the largest domain name community on the internet and continues to grow every day. There are over 105,000 domainers on DNForum doing everything from buying domains, selling domains, learning about domains and discussing domains. Take a minute and Register.

Register Today on DNForum IT'S FREE!

Results 1 to 1 of 1
  1. #1
    The One
    VisualDigits's Avatar
    Join Date
    Mar 2005
    Location
    New Jersey
    Posts
    1,917
    DNF$
    1,212
    Bank
    0
    Total DNF$
    1,212
    Donate  

    Unhappy Help me write mod rewrite code

    I'm using the following code to rewrite my urls and thankfully it's working:
    RewriteCond %{REQUEST_URI} ^/([^/]+)/([^/]+)/([^/]+)/([^/]+)
    RewriteRule ^(.*) /index.php?menu=%1&cat=%2&artist=%3&title=%4 [L]
    but I want it to work for every directory. I tried the following but it doesn't seem to work:
    RewriteCond %{REQUEST_URI} ^/([^/]+)/([^/]+)/([^/]+)
    RewriteRule ^(.*) /index.php?menu=%1&cat=%2&artist=%3 [L]
    RewriteCond %{REQUEST_URI} ^/([^/]+)/([^/]+)
    RewriteRule ^(.*) /index.php?menu=%1&cat=%2 [L]
    RewriteCond %{REQUEST_URI} ^/([^/]+)
    RewriteRule ^(.*) /index.php?menu=%1 [L]


    Can anybody help?

    I want to achieve the following:
    http://www.slack-time.com/music-videos/
    http://www.slack-time.com/music-videos/RnB-Music/
    http://www.slack-time.com/music-vide...c/Alicia-Keys/
    http://www.slack-time.com/music-vide...cia-Keys/Karma

    Anybody?

    I got the code finally and it's working like a charm:

    Code:
    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^(.*)/(.*)/(.*)/(.*)/$ index.php?menu=$1&cat=$2&artist=$3&title=$4 [L]
    RewriteRule ^(.*)/(.*)/(.*)/$ index.php?menu=$1&cat=$2&artist=$3 [L]
    RewriteRule ^(.*)/(.*)/$ index.php?menu=$1&cat=$2 [L]
    RewriteRule ^(.*)/$ index.php?menu=$1 [L]
    Last edited by DomainMaster; 04-16-2005 at 10:32 PM. Reason: Automerged Doublepost
    Cogito, ergo sum!

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
  •  

Domain name forum recommended by Domaining.com