Results 1 to 7 of 7

Thread: .htaccess troubles

  1. #1
    Join Date
    Dec 2008
    Posts
    28
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default .htaccess troubles

    how would i go about changing my urls that look like this;

    http://localhost/profile/index.php?user=adam

    to something like this;

    http://localhost/profile/adam

    Any help would be appreciated. =]

  2. #2
    Join Date
    Sep 2008
    Posts
    56
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Default Re:- .htaccess troubles

    Hi,

    Put this code in your .htaccess file and it should solve the purpose: -

    RewriteCond %{HTTP_HOST} ^localhost/profile/index.php?users=$ [NC]

    RewriteRule ^(.*)$ http://localhost/profile/$1 [R=301,L]

    Hope this works for you!


    Cheers,

    ~Maneet Puri

  3. #3
    Join Date
    Jun 2007
    Posts
    543
    Thanks
    3
    Thanked 78 Times in 78 Posts
    Blog Entries
    1

    Default

    try:
    Code:
    RewriteEngine on
    RewriteRule ^profile/([a-z]+)$ profile/index.php?user=$1 [L]
    [Jasme Library (Javascript Motion Effects)] My Site
    /\/\@ /\/\@|{
    There are 10 kinds of people in the world, those that understand binary and those that don't.

  4. #4
    Join Date
    Dec 2008
    Posts
    28
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default

    Both of those codes showed no response ='/
    But im using my localhost as a tester...
    would that make a difference?

  5. #5
    Join Date
    Jul 2008
    Posts
    199
    Thanks
    6
    Thanked 58 Times in 57 Posts

    Default

    You'll get a big 'ol error if you don't have mod_rewrite installed.

    Try placing a .htaccess file in /profile with the following contents:
    Code:
    RewriteEngine On
    RewriteRule ^([a-z]+)$ index.php?user=$1
    RewriteBase /profile/

  6. #6
    Join Date
    Dec 2008
    Posts
    28
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default

    Quote Originally Posted by techietim View Post
    You'll get a big 'ol error if you don't have mod_rewrite installed.

    Try placing a .htaccess file in /profile with the following contents:
    Code:
    RewriteEngine On
    RewriteRule ^([a-z]+)$ index.php?user=$1
    RewriteBase /profile/
    that didn't work either
    and how do check to see if i have mod_rewrite installed?

  7. #7
    Join Date
    Dec 2008
    Posts
    28
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default

    could it be the .htaccess file that is causing this?

Tags for this Thread

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
  •