On my site when a link is clicked, the adress bar in the browser shows this URL:
http://www.enkelt-webdesign.dk/index.php?sid=1&titel=FORSIDE
I would lke the URL to appear like this:
http://www.enkelt-webdesign.dk/Forside
I have this code in my .htacess file which is not working as it is:
<ifModule mod_rewrite.c>
RewriteEngine on
#Regler til index.php
RewriteRule ^Forside$ index.php?sid=1&titel=FORSIDE
</ifModule>
THIS IS ACTUALLY WORKING, WHEN THIS LINKED IS FOLLOWED - BUT THEN WHEN I CLICK ON THE LINK AFTER I HAVE ARRIVED TO THE PAGE, THEN I GET THE UGLY URL WITH THE QUERY STRING AGAIN. HOW CAN I KEEP THE PRETTIER URL WHEN THE ON SITE LINK IS CLICKED??
Isnt it correct to first specify the text/word, you want to replace with?
And just after write the entire line that you want stripped away from the URL?
In my case I want to change the entire query string, and replace it with a SEO friendly word for the user to see. (Well in this case: www.domain.dk/Forside)
What am I dong wrong?
My navigation is build like this:
function subject_navigation($connection){
$subjectset = mysqli_query($connection, "SELECT id, titel, linknavn FROM subjects ORDER BY pos ASC");
while($subject = mysqli_fetch_array($subjectset)){
$linknavn = $subject['linknavn'];
$linknavn = strip_tags($linknavn);
$sid = $subject['id'];
$subjectlinklabel = $subject['linknavn'];
// Class for aktivt link:
if(isset($_GET['sid']) && $sid==$_GET['sid']){
$active = 'class="aktivt_link"';
} else {
$active = '';
}
echo '<li>
<a href="index.php?sid=' .$sid . '&titel='.$linknavn.'">' . $subjectlinklabel . '</a></li>';
}
}
Should my $_GET be constructed differently than shown above? I mean whats "inside" of the a tag?
Regards, klemme