Forum Moderators: phranque

Message Too Old, No Replies

"Help on Mod_rewrite"

"How do i apply mod_write on my whole site"

         

greendesert

7:24 am on Mar 10, 2006 (gmt 0)

10+ Year Member



Hi,
I have studied the mod_rewrite mechanism and succeede in showing from old.html to new.html.
But now i want that transfering the www.abc.com/index.php to www.abc.com/index.html.
How it is possible to implement this on my whole site.

Thanks in Advance.
Asif Arif

jdMorgan

2:03 pm on Mar 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Asif,

Welcome to WebmasterWorld!

Assuming that the server is configured with RewriteOptions inherit, then any mod_rewrite code in your Web root directory --the directory containing your "home page" and robots.txt, for example-- will apply to your entire site.

This is also true with the simpler and easier-to-use mod_alias directives, such as


Redirect 301 /index.php http://www.example.com/index.html

For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].

Jim

greendesert

6:26 am on Mar 11, 2006 (gmt 0)

10+ Year Member



Thanks for your help, but i want to do this with mod_rewrite, rewriting from www.abc.com/index.php to www.abc.com/index.html, where index.html is not a physical file, i want that index.php file sould be opened but the address bar showed the address as www.abc.com/index.html.

Thanks alot.

jdMorgan

6:38 pm on Mar 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In that case, use Apache mod_rewrite (see the cited documentation, please) and do an internal rewrite of the requested index.html URL to the internal index.php script.

Jim

greendesert

6:00 am on Mar 11, 2006 (gmt 0)

10+ Year Member



Hi,

If a hyper refrence populates the address like index.php that is a file and physically exists, it should be opened but with the help of mod_rewrite we want that index.php file should be opened but in the address bar the the index.html should be displayed(it is not a phycial file, not exists).
So, how we can achieve this.

Thanks.