php - htaccess need name in front of domain


So i have a file named page.php, which has 2 get variables. the u and edit so at the moment i have &

But how can i make the url look like this using htaccess? &

At the moment i have tried this

RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ page.php?u=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ page.php?u=$1

but this just makes



If I understand your requirement correctly, you can use:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([\w-]+)/?$ page.php?u=dan&$1 [L,QSA]

People are also looking for solutions to the problem: php - How do I make Buttons in Wordpress site?


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.