Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteRule ^check\.html$ check.php [T=application/x-httpd-php,L] ///////////////////////////////////////////////////////////////////////////// I have 2 files index.php & check.php in the folder test on the ftp server. The index.php file has the link on the page like <a href="check.php">Click here</a> when i access the index.php file on the server by writing www.abc.com/test/index.php in the address bar, the index.php file opens but in the address bar the address remains same as index.php instead index.html. when i click on the link to go on the check.php, the check.php file opens but the address in the address bar remains same check.php instead check.html. How it is possible these files open with .php extensions but in the address bar the addresses showed as .html extension. For this i am using the above code, but is not working to show .html extension in the address bar. thanks, it is small and easy task but hard for me.
Not sure I understand what you try to do... With your .htaccess, when you type ....../check.html in the address bar, I guess that you open check.php. When you type ....../check.php in the address bar, the .htaccess does not change anything and you also open check.php. As it is now, that's all what your .htaccess does. You could redirect from check.php to check.html. Then, when you type check.php, the server will display check.html in the address bar and open check.html (not check.php). Jean-Luc
If you want to get check.html, you have to link to that page. mod-rewrite doesn't make you link to a different page, it only makes the URL work. Change the link to.... <a href="check.html">Click here</a>
HI, Thanks for ur help. Actually i have a small website, that has login,logout,contactus,registeration links. whenever i clicks on the contactus, the new page contactus.php opens and address bar shows the address as www.abc.com/contactus.php, but i want that the address bar showed the address as www.abc.com/contactus Then what will be the rewrite code for this. Thanks in advance.
Hi, Is it possible to our updated .htaccess & other files on our local system rather than on FTP server. I listened that, some extra modules are required for this to install on your local system, but don't know. If you know kindly help me to install this. I will be very thankful to you for this. Thanks
Arg!!!! mod_rewrite doesn't change URLs, it only makes the URLs work. If you can't make the link be what ever you want it, then mod_rewrite won't work. E-mail the crummy web host..or even better....get a new one!!!!
HI, I think, u can use these to convert the .php extensions to .html, rather these files populate from hyper refrence in the form of <a href="index2.php">click here for file2</a>, this file opens but the address bar will show the address as www.abc.com/index2.html //////////////////////////////////////////////////////////////////////////////////// RewriteEngine On RewriteCond %{ENV:REDIRECT_STATUS} !^200$ RewriteCond %{REQUEST_URI} ^(.+)\.php$ RewriteRule .* %1.html [R,L] RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^(.+)\.html$ $1.php [L] //////////////////////////////////////////////////////////////////////////////////// Now i am asking that what are the apache's extra modules with the help of which we can run over .htaccess & and other files on our local system rather than uploading on the FTP server. Thanks in advance for your response.
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^([^.]+)\.php$ http://www.domain.com/$1.html [R=301,L]
er...except to do that, the whatever.html page has to exist. Do you have SSI? Try index.shtml with just <!--#include virtual="/whatever.php" --> in it.