This question already has an answer here:
- htaccess pretty urls setup 2 answers
I'm finally asking my first question on Stackoverflow:
I'm creating a website which has the base template (header, menu, footer) as the index.php and all the content links will call the index.php with a parameter called '?page=asdf'. (I hope it's a reasonable strucutre for a business site.)
<div class="page_wrapper">
<?php
if (isset($_GET['page'])){
include 'tpl/'.$_GET['page'].'.php';
}
else{
include 'tpl/start.php';
}
?>
</div>
Now i want to rewrite the urls without the .php at the end like page.com/index.php?get=products should be page.com/products. The same for 'about', 'contact' and so on. And the startpage should always be like page.com/
One of the important points is that it should be multilingual in English & German and I really don't know how to it. Do I have to make each Filename in German and English ?
I did it 2 years ago only with one language but I can't remind how I did it and lost the source code.
<=============================>
GOT IT:
I used RewriteRule ^([^/]+)/?$ index.php?page=$1 [L]
Thanks @Jon Lin for the help, you brought me to this idea.
</div>