0

I saw many website user page is like
www.xyz.com/hhh

From these complete information can be retrive of "hhh" user.

I want to know that how www.xyz.com?username=hhh can be convert to www.xyz/hhh
Any help

Edited by newbie1234

7
Contributors
9
Replies
12
Views
5 Years
Discussion Span
Last Post by IIM
0

i think it is not possible

Well, actually it is. It's called url rewrite. Maybe this link can help you understand how it works in an Apache webserver.

0

In order to achieved this, you, would have to use url re-write (like @Nichito pointed out)

You would still have your username.php which accepts the paramater (hh).

<?php

  $user = $_GET['username']; // Obviously with a bit more security 

  var_dump($user);

  ?>

Hope this helps

Edited by phorce

0

http://roshanbh.com.np/2008/03/url-rewriting-examples-htaccess.html

See example #4.

Its not workin . I have already .htaccess file and i added in the last but its not working

my .htaccess file is as follow..

RewriteEngine On
Options +Followsymlinks
RewriteBase /

    ## Dissable directory indexing ##
    Options -Indexes

## Remove trailing slash from end of uri ##
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) $1\.php [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ /$1 [R=301,L]

# Redirect to non.php extension
RewriteCond %{THE_REQUEST} ^GET\ /([^/]+/)*[^.]+\.php(\?[^\ ]*)?\ HTTP/
RewriteRule ^(([^/]+/)*[^.]+)\.php$  $1 [R=301,L]

## Rewrite Rules ##
RewriteRule ^([0-9-a-z-A-Z-_]+)/?$ goto.php?id=$1 [L]
RewriteRule ^account/(.*)$  $1.php [L]


RewriteRule ^([a-zA-Z0-9_-]+)$ user.php?username=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ user.php?username=$1

Please check this and reply.....

0

Your first rewrite redirects redirects all non files, and following rules will not be processed. I think it is getting in the way.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.