Forum Moderators: phranque

Message Too Old, No Replies

Mode_rewrite snag

I am clueless!

         

henry0

6:33 pm on Mar 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello,
Is it possible applying mode_rewrite to the content of a folder located at root level
That contains PHP files and has an index.php
But knowing that the site index is index.html

This mode rewrite utilizes OB and works fine with another site
However the root index has a PHP extension as index.php

To fully understand what I am trying to achieve please look at my previous post

My other post [webmasterworld.com]

Thank you

jatar_k

1:52 am on Mar 26, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



shameless mod bump and move ;)

jdMorgan

3:33 am on Mar 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If I understood your question...

Add a RewriteCond so that index.html is only rewritten to index.php if index.html is requested in the /display_hp subdirectory:


RewriteEngine on
RewriteRule (index.php)-([^-]+)-([^-]+)\.html$ $1.html?$2=$3 [N,QSA]
RewriteCond %{REQUEST_URI} ^/display_hp/
RewriteRule index\.html$ index.php [L]

Alternately, always rewrite index.html to index.php, unless the request for index.html is made to the root directory:

RewriteEngine on
RewriteRule (index.php)-([^-]+)-([^-]+)\.html$ $1.html?$2=$3 [N,QSA]
RewriteCond %{REQUEST_URI} !^index\.html$
RewriteRule index\.html$ index.php [L]

Jim

henry0

11:39 am on Mar 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Jim,
Thank you very much
I will test and report

Henry