www.webdeveloper.com
Results 1 to 3 of 3

Thread: .htaccess URL Rewrite

  1. #1
    Join Date
    Mar 2009
    Posts
    452

    .htaccess URL Rewrite

    Hi all, i here with a new problem, i am trying to rewrite url in a site

    http://domain.com/products.php?uid=123
    to
    http://domain.com/abc/products.php

    it goes fine

    but when i try this
    http://domain.com/abc/product-detail.php?pid=456

    pid is not set, i don't get any value in pid, redirect.php has the code to include the requested page

    here is my .htaccess

    Code:
    <IfModule mod_rewrite.c>
    	RewriteEngine on
    	
    	RewriteCond %{REQUEST_FILENAME} !-f
    	RewriteCond %{REQUEST_FILENAME} !-d
    	RewriteRule ^([a-zA-Z0-9_-]+)$ redirect.php?c=$1
    	
    	RewriteCond %{REQUEST_FILENAME} !-f
    	RewriteCond %{REQUEST_FILENAME} !-d
    	RewriteRule ^(.*)/$ redirect.php?c=$1
    	
    	RewriteCond %{REQUEST_FILENAME} !-f
    	RewriteCond %{REQUEST_FILENAME} !-d
    	RewriteRule ^(.*)/(.*)\.php$ redirect.php?c=$1&p=$2
    	
    </IfModule>

  2. #2
    Join Date
    Feb 2011
    Posts
    231
    Hi,
    Try replace your line with this:
    Code:
    RewriteRule ^([^\/]+)/([^\.]+)\.php$ redirect.php?c=$1&p=$2

  3. #3
    Join Date
    Mar 2009
    Posts
    452
    dosent do anything... any other

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles