0

The problem I m facing that I am receiving an id from url and showing it simply

http://localhost/test/?username=bingo123

Its working fine and shows the result

But I want that I should be able to write like

http://localhost/test/bingo123 .

I tried to make .htaccess file and but it does not work and shows

The requested URL /test/bingo123 was not found on this server

Rewriteengine on Rewriterule ^([a-zA-z]+)$ index.php?username=$1 

I want to know that what should i change make in .htaccess file or some other settings in Wamp to run the script and where should I save .htaccess so that It works fine .Here "test" the folder name where all php files are there and how to save the .htaccess file as it does not allow it to save without first name.

Thanks in advance.

1

3 Answers 3

1

Try like this

RewriteEngine On RewriteRule ^test/([^/]*)$ /test/?username=$1 [L] 
Sign up to request clarification or add additional context in comments.

Comments

0

Myabe Helpful

RewriteRule ^test/([a-zA-Z]+)$ test.php?username=$1 [L] RewriteRule ^test/([a-zA-Z]+)/([a-zA-Z]+)$ test.php?username=$1/$2 [L] RewriteRule ^test/([a-zA-Z]+)/([0-9]+)$ $ test.php?username=$1[L] 

Comments

0
 RewriteEngine On RewriteRule ^test/([a-zA-Z0-9-=_.]+)$ test.php?username=$1 [L] 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.