PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
RewriteEngine On
RewriteRule ^/$ index.php?page=home&menu=home[L]
Hi.
I am trying to get the htaccess to work for the first time - I've never done this before. Am reading all about it, but frankly I only need it for the homepage. ie. http://www.domain.co.uk/
That needs to go to the full index.php...... url.
How do I use my rewrite code to do this??
Simon
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
If possible, this is something you should set up in the Apache config files. I think there's a directive for default page, or directory index, or something along those lines. If you can't change the config files, you should be able to use those exact same directives in your .htaccess file. You don't need mod_rewrite for this.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
RewriteEngine On
RewriteRule ^$ index.php?page=home&menu=home [L]
EDIT
Pickle, didn't see you there. Probably better option tbh. Yeah, there should be a directoryindex directive, where you can specify several pages, which will be tried for existence in order.
DirectoryIndex index.htm index.html index.php
order allow,deny
deny from 81.144.190.133
allow from all
Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteRule ^$ index.php?page=home&menu=home&head=welcome [L]
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.