Hello Any one know the rules for htaccess,
I have follow requirement:
http://www.domainname.com/aboutus.php--input
http://www.domainname.com/aboutus/--Need this output
Hello Any one know the rules for htaccess,
I have follow requirement:
http://www.domainname.com/aboutus.php--input
http://www.domainname.com/aboutus/--Need this output
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.yoursitename.com [NC]
rewritebase /
RewriteRule ^$ index.php [L]
RewriteRule ^index index.php [L]
RewriteRule ^aboutus aboutus.php [L]
last post save as .htaccess and next define below code in config page
$Site_URL = "http://yoursitename/";
define('SITE_URL',$Site_URL);
call now page like this
<a href="<?=SITE_URL?>aboutus">aboutus</a>
Thanks for your reply,
I think this rule is just for aboutus, But I need the generic solution for any page like domainname.com/anypage.php to domainname.com/anypage.
thanks again..:-)
try this one.
RewriteRule (.*) $1.php
RewriteRule ^(.*)\$ /$1.html [R=301,L]
you can get more information from http://www.askapache.com/htaccess/mod_rewrite-tips-and-tricks.html
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.