Advertisement

08.07.2008 at 08:08PM PDT, ID: 23631621 | Points: 500
[x]
Attachment Details

how to have a htaccess rule not effect the root index file

Asked by paulp75 in Apache Web Server, PHP Scripting Language, PHP and Databases

The htaccess below works well with all the dynamic urls, but the problem is that when i remove the / from the third line so it looks like
RewriteRule ^([^/]*)$ /php/page.php?page_filename=$1 [L]
so that i can display http://www.domain.com/page_filename
without the trailing slash, i am unable to display http://www.domain.com/
is there any way to make an exception to the rule so that when the root document is loaded, that it will still show index.php instead of php/page.php

thanks for any helpStart Free Trial
1:
2:
3:
RewriteEngine On
RewriteRule ^product-detail/([^/]*)\.php$ /product_detail.php?product_filename=$1 [L]
RewriteRule ^([^/]*)/$ /php/page.php?page_filename=$1 [L]
[+][-]08.07.2008 at 10:58PM PDT, ID: 22187716

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.08.2008 at 03:46AM PDT, ID: 22188763

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.08.2008 at 04:32AM PDT, ID: 22188952

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.08.2008 at 05:00AM PDT, ID: 22189072

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.09.2008 at 06:22PM PDT, ID: 22198381

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44 / EE_QW_2_20070628