Hi all
I need some help with .htaccess
How do I rewrite index.php?page=home
to
home.html
thanx in advance
Hi all
I need some help with .htaccess
How do I rewrite index.php?page=home
to
home.html
thanx in advance
Instead of using htaccess you could just add a bit of code to the top of index.php
PHP Code:<?php
if ($_GET['page'] == 'home') {
header("location:home.html");
}
?>
Last edited by Dead-i; 09-03-2011 at 12:31 PM.
RewriteCond %{QUERY_STRING} ^page\=home(\&.+)?$
RewriteRule ^index.php$ test.php
Or if ever you want to preserve the $_GET 's
RewriteCond %{QUERY_STRING} ^page\=home(\&.+)?$
RewriteRule ^index.php$ test.php?%{QUERY_STRING}
Then on .htaccess it'll look something like this
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} ^page\=home(\&.+)?$
RewriteRule ^index.php$ test.php?%{QUERY_STRING}
</IfModule>
hi Thank you
but how to make it work like this:
if I type in the url:
http://webradioo.x10.mx/home.html
that .htaccess interprets this as:
http://webradioo.x10.mx/index.php?p=home
I now use this script, but it doesn't work that well yet:
thank you in advance for your time and knowledgeCode:RewriteBase / RewriteRule ^([^/]*)\.html$ index.php?%{QUERY_STRING} [NC]
You can use HTML to redirect home.html. In between <head> and </head> type this:
So, in your entire document, it might look like this:Code:<meta http-equiv="refresh" content="0;url=index.php?p=home">
Code:<html> <head> <title>My Website</title> <meta http-equiv="refresh" content="0;url=index.php?p=home"> </head> <body> </body> </html>
That should do itCode:RewriteRule ^home.html$ index.php?p=home&%{QUERY_STRING}