SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mod_rewrite problem.

    It is actually the continue on an existing thread in Apache Configuration forum but I am bit in hurry so i am begging help if anyone can help from here PHP forum.

    It is really weird at least for me. When i tried the following:
    Code:
    RewriteEngine on
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    RewriteRule ^/?products/([\-a-zA-Z\d]+)/?$ index.php?show=products&category=$1 [L]
    RewriteRule ^/?product/([\-a-zA-Z\d]+)/?$ index.php?show=product&product=$1 [QSA,L]
    RewriteRule ^/?cms/([\-a-zA-Z\d]+)/?$ index.php?show=cms&content=$1 [L]
    Rest of two are working fine but when try:
    Code:
    http://localhost/projectname/product/name-of-the-product/?category_id=12
    It redirects to :
    Code:
    http://localhost/projectname/products
    Can anyone please tell me the reason why this is happening?
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    redirects, meaning the location in the browser url bar changes?

  3. #3
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, the location in the browser.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  4. #4
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would be looking at other .htaccess files, or inside the php script itself.

  5. #5
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by crmalibu View Post
    I would be looking at other .htaccess files, or inside the php script itself.
    Hey crmalibu, I don't know what do you mean by 'inside the php script' but you really spot it with the quote. there was condition in product details page that if there is no product code/id then i had redirected to products page.

    Umm really thank you crmalibu.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5


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
  •