Hi I am trying to change my url using htaccess but it didn’t work anymore.
http://localhost:8888/cPanel/abc?page=general-settings
RewriteRule ^cPanel/([w-]+)/?$ abc.php?page=$1 [L,QSA]
What i am doing wrong anyone can help me here please ?
I want to change the url like this:
http://localhost:8888/cPanel/general-settings
<?php
$page ='';
if($_GET['page']){
$page = $_GET['page'];
if($page == 'general-settings'){
include "/pages/general-settings.php" ;
}
}
?>
2
Answers
Test this code
url: http://localhost:8888/cPanel/general-settings
The error stands in the rule. Your actual rule is:
which is missing
cPanel
, if you want to achievehttp://localhost:8888/cPanel/general-settings
as resultWith this rule (which means: when you Apache match
cPanel/*anything*
, hit the resource atcPanel/abc.php?page=*anything*
) it should work: