mod_rewrite.

  • conn2prince
  • Graduate
  • Graduate
  • User avatar
  • Joined: 28 Jun 2005
  • Posts: 119
  • Status: Offline

Post April 26th, 2006, 11:51 pm

1- I have 2 file index1.php and index2.php, index1.php has a hyper link like <a href="index2.php">Click here</a>, after clicking on this the user is transfered to index2.php, i want that the user to view index2.html in the web page & also in the address bar the address should be looked index2.html instead index2.php

2- I have my site http://localhost/mysite/ and i have the main page for this index.php,
i want that whenever a user approaches to my site, the main page index.php should be displayed with displaying address http://localhost/mysite/index.html rather than http://localhost/mysite/index.php.

What would be the rewriteconditions & rewriterules for these and where shld i place the .htaccess file. All my files will be under http://localhost/mysite/
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post April 26th, 2006, 11:51 pm

  • meman
  • Web Master
  • Web Master
  • User avatar
  • Joined: 03 Aug 2004
  • Posts: 3432
  • Loc: London Town , Apples and pears and all that crap
  • Status: Offline

Post April 27th, 2006, 12:30 am

I would use this in an htaccess
<FilesMatch "index2.html">
ForceType application/x-httpd-php
</FilesMatch>


That will mean the page2.html file can contain php, and will be processed as php on the server, but will have an html extention in the URL.
  • conn2prince
  • Graduate
  • Graduate
  • User avatar
  • Joined: 28 Jun 2005
  • Posts: 119
  • Status: Offline

Post April 27th, 2006, 12:39 am

then wht abt the Rewrite rule.....i do have many php files.how can i make use of ur code for all those files

Post Information

  • Total Posts in this topic: 3 posts
  • Moderator: Moderator Team
  • Users browsing this forum: No registered users and 84 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© Unmelted Enterprises 1998-2009. Driven by phpBB © 2001-2009 phpBB Group.