simple url rewriting

Hello experts;
I want to use this url rewriting (.htaccess)

http://www.mysite.com/ana

so it points to
http://www.mysite.com/artiste-bio.php?username=ana

Any clues ?

I use linux / apache / php
yarekGmailAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lukasz ChmielewskiCommented:
Try this:

RewriteRule http://www.mysite.com/([^/]*)$ http://www.mysite.com/artiste-bio.php?username=$1 [L]

Open in new window

0
yarekGmailAuthor Commented:
does not seem to work.
Besides I just realized : it will work badly with files like /images /scripts /admin etc..
Do you have a suggestion to simplify this kind of url ?

http://www.mysite.com/artiste-bio.php?username=ana

Regards
0
COBOLdinosaurCommented:
What are you using the parameter for; a re-direct or query?


Cd&
0
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

yarekGmailAuthor Commented:
for a SQL quesry
0
COBOLdinosaurCommented:
Okay you currently hit http://www.mysite.com/ana where it by default goes to http://www.mysite.com/ana/index.php

so why not do a php re-direct in index.php like this

header("Status: 301 Moved Permanently");

header("Location:http://www.mysite.com/artiste-bio.php?". $_SERVER['QUERY_STRING']);

Open in new window




Cd&
0
yarekGmailAuthor Commented:
No,
I think I expressed myself badly

http://www.mysite.com/ana   goes to  http://www.mysite.com/artiste-bio.php?username=ana
http://www.mysite.com/john goes to  http://www.mysite.com/artiste-bio.php?username=john
etc...
except for
http://www.mysite.com/images/
http://www.mysite.com/scripts/
http://www.mysite.com/admin


Is it something that can be done with .htaccess ?

regards
0
COBOLdinosaurCommented:
If the rewrite that Roads_Roads does not do it than I have no idea.

What I gave you should work, but you have to set up the index.php for each of their directories.

You are doing a major structural change in the file system, so there is some work involved.

I wish I had more for you.  There may be some other rewrite rule that could be used but I don't use rewrite enough to be definitive about whether it is possible.


Cd&


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.