Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Senior Member Blackhawk095's Avatar
    Join Date
    May 2011
    Location
    Kentucky (USA)
    Posts
    384
    Member #
    27969
    Liked
    45 times
    I have been working on this .htaccess file for about 2 hours, and I can't seem to solve my issue.

    On the website I'm developing, the pages are generated based on the URL parameters. I have 3 specific params:

    - template ($t)
    - view ($v)
    - action ($a)

    Using a .htaccess file, I removed the keys from each value.

    Example:

    Instead of
    Code:
    http://designcryptcms.com/dc-admin/?t=register&v=confirmAccount&a=78923578914
    I want:
    Code:
    http://designcryptcms.com/dc-admin/register/confirmAccount/78923578914
    My problem is that when I use more than one parameter, the value of ($t) defaults to index.php.
    Code:
    http://designcryptcms.com/dc-admin/index.php/confirmAccount/78923578914
    Here is my .htaccess file:
    Code:
    RewriteEngine On
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-F
    
    RewriteRule ^([^/]+) index.php?t=$1 [C]
    RewriteRule ^([^/]+)/([^/]+) index.php?t=$1&v=$2 [C]
    RewriteRule ^([^/]+)/([^/]+)/([^/]+) index.php?t=$1&v=$2&a=$3 [L]
    What am I doing wrong?
    [COLOR=rgb(0, 51, 102)]Student Web Designer[/COLOR]
    [COLOR=rgb(0, 51, 102)]If you thought something I said was helpful. LIKE IT![/COLOR]

  2.  

  3. #2
    Senior Member Blackhawk095's Avatar
    Join Date
    May 2011
    Location
    Kentucky (USA)
    Posts
    384
    Member #
    27969
    Liked
    45 times
    Anyone?
    [COLOR=rgb(0, 51, 102)]Student Web Designer[/COLOR]
    [COLOR=rgb(0, 51, 102)]If you thought something I said was helpful. LIKE IT![/COLOR]

  4. #3
    Senior Member Blackhawk095's Avatar
    Join Date
    May 2011
    Location
    Kentucky (USA)
    Posts
    384
    Member #
    27969
    Liked
    45 times
    i fixed the .htaccess file. it is now working correctly.

    Here is the solution for anyone interested:
    Code:
    RewriteEngine On
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-F
    
    RewriteRule ^([^/]+) index.php?t=$1 [QSA]
    RewriteRule ^([^/]+)/([^/]+) index.php?t=$1&v=$2 [QSA]
    RewriteRule ^([^/]+)/([^/]+)/([^/]+) index.php?t=$1&v=$2&a=$3 [QSA,L]
    [COLOR=rgb(0, 51, 102)]Student Web Designer[/COLOR]
    [COLOR=rgb(0, 51, 102)]If you thought something I said was helpful. LIKE IT![/COLOR]


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:12 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com