Question

I have a project am working on but I got a problem.

Problem

Main GET data: www.enterr.com/profile.php?username=beraki

Will be : www.enterr.com/beraki This is ok

But I have a 2 GET data url : www.enterr.com/profile.php?username=beraki&mode=about I would like it to be : www.enterr.com/beraki/about

And if I have a 3 GET data url I want them all to be friendly as above.

Était-ce utile?

La solution

Try this for two get data:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/(.*)$ profile.php?dataone=$1&datatwo=$2

Try this for three get data:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/(.*)/(.*)$ profile.php?dataone=$1&datatwo=$2&datathree=$3

The above codes work, checked it. Just replace dataone, datatwo, datathree with the data you are passing.

Autres conseils

try something like

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(.*)/(.*)/(.*)$ profile.php?username=$1&mode=$2&third=$3
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top