Forum Moderators: phranque

Message Too Old, No Replies

Mod rewrite

         

khangpn

8:29 am on Jan 25, 2005 (gmt 0)

10+ Year Member



Hello All,

I've a problem about that:
for example:
www.abc.com/home/index.php will be rewrite to www.abc.com/index.php (any file in folder HOME)

my code below:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /home
RewriteRule ^index\.php$ index.php

Its wrong, i dont understand? could you help me?

Thank a lot!
Khang.phan

valder

12:26 pm on Jan 25, 2005 (gmt 0)

10+ Year Member



Hi and welcome to WebmasterWorld :)

The character ^ means that the line must start there, but your request line starts with "home/". Either remove the ^ or insert home/ right after it. Then it will rewrite home/index.php to home/index.php, but that's obviously no use, so add a slash in front of the target index.php to request /index.php.

It should be something like this:

RewriteBase /home
RewriteRule index\.php /index.php
,

Eivind

dcrombie

1:10 pm on Jan 25, 2005 (gmt 0)



This might be what you're looking for:

RewriteRule ^home/ /index.php

valder

3:03 pm on Jan 25, 2005 (gmt 0)

10+ Year Member



Yes, you don't really need the RewriteBase for such a task. That last one is much better as long as you don't have other RewriteRules that depend on the RewriteBase.

khangpn

3:29 am on Jan 26, 2005 (gmt 0)

10+ Year Member



Thanks for your kind support

I still have problem.
My website work on real folder home
1. when you type www.abc.com, in root folder file index.htm will be redirect to home/home.php
2. I would like to see on URL www.abc.com/home.php (any file in folder home will see on URL is www.abc.com(no see /home)), but any file real run on folder home.

Thanks to all of you!

Khang.phan