Organizational Research By

Surprising Reserch Topic

.htaccess file and URL rewrite rule in php?



asked Sep 13, 2013 in PHP by ashish singh
edited Sep 12, 2013
0 votes
31 views



Related Hot Questions

1 Answer

0 votes
.htaccess file and URL rewrite rule in php
 
Redirect URLs using .htaccess  :   
You can use .htaccess to redirect users to a different URL(redirect a url)     
Sometimes you need to redirect some URL and/or page on your site to another one.     
using the “Redirect” directive:     
    
Redirect /folder http://www.example.com/newfolder      
    
Another useful directive is the RedirectMatch     
    
RedirectMatch "\.html$" http://www.example.com/index.php      
    
This will redirect all requests to files that end with .html to the index.php file.       
One of the more powerful tricks of the .htaccess hacker is the ability to rewrite URLs     
    
simple rewriting         
all requests to whatever.htm will be sent to whatever.php:     
Options +FollowSymlinks      
RewriteEngine on      
RewriteRule ^(.*)\.htm$ $1.php [NC]      
RewriteRule ^menu.html menu.php  
answered Sep 13, 2013 by ashish singh
edited Sep 12, 2013

...