Reputation: 13
.htaccess file is not working... I don't know Why ?? Help me out here is my code .htaccess file
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
Rewrite
Rule ^(.*)$ index.php?name=$1 [QSA,L]
and php file.
if (isset($_GET['usernamess']) === true && empty($_GET['usernamess']) === false) {
$usernamess = $_GET['usernamess'];
echo $usernamess;
}else {
header('index.php');
}
Upvotes: 0
Views: 35
Reputation: 584
Try this in your Root/.htaccess file :
RewriteEngine On
RewriteCond %{THE_REQUEST} /index\.php\?name=([^\s]+) [NC]
RewriteRule ^ /%1? [NC,R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ index.php?name=$1 [QSA,L,NC]
and name and usernamess should be the same
Upvotes: 1