Current location: Hot Scripts Forums » Programming Languages » PHP » php/htaccess problem


php/htaccess problem

Reply
  #1 (permalink)  
Old 05-22-05, 12:11 PM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
php/htaccess problem

I am trying to make all .htm pages actually include .php pages. In my htaccess I have:

Code:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.htm index.php?page=$1
The switch in index.php looks like:

PHP Code:

<?php

$switch 
$_REQUEST['page'];
$switch addslashes($switch);

if (!isset(
$switch)) {
include (
"home.php");
}
if (!
file_exists("$switch.php")) {
include (
"home.php");
}
else {
include (
"$switch.php");
}
?>
When I go to 'about.htm' it just displays 'about.php' when in fact it should show 'index.php?page=about' any help?
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie found a solution to a date problem. mickey_kamer Perl 4 05-09-07 05:54 AM
header redirect problem loeddie PHP 2 05-18-05 11:22 AM
A Language filter problem, and a problem with a for loop querying my database. . . Spreegem PHP 6 05-08-05 11:03 AM
Count problem kasic ASP.NET 1 10-20-04 12:23 AM
Asp and Microsoft Access 2002 problem gop373 ASP 2 10-06-04 09:13 AM


All times are GMT -5. The time now is 06:45 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.