Forum Moderators: phranque
I have a situation where I have to create a PHP based 2 page website builder engine.
I have almost done that. But here is the thing i need to do.
The file name that is generated through the engine is INDEX.PHP and that have some PHP code in it.
now I want to do the necessary coding in the .htaccess etc, that will treat that index.php file as index.html file.
Another issue is that the INDEX.PHP will have a variable with it means, the links in it are something like this index.php?state=alabama
What i want is that, if a user click on the link for ALABAMA the mod rewrite convert INDEX.PHP?STATE=ALABAMA to ALABAMA.HTML
Please guide !
Thanks
Zeeshan
RewriteCond %{QUERY_STRING} ^STATE=([^/]+)$
RewriteRule ^INDEX\.PHP$ [yourdomain...]
RewriteRule ^index\.html INDEX.PHP
I am not sure about it perfection. But you may try.
Thanks
Mahabub
[edited by: Mahabub at 10:05 am (utc) on Dec. 14, 2008]
Look into getting rid of those uppercase filenames, URLs, and query string variables. Using uppercase is going to cause you problems in the long term, because almost no-one uses uppercase on the Web. Webmasters and even some search engines are likely to try to link to your pages using lowercase or mixed-case URLs. Therefore, you will probably have to include case-conversion code in your .htaccess, and this is complex, slow, and inefficient.
See my comments in your recent thread [webmasterworld.com] about why the code you posted won't work properly.
Jim