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

Recommended Answers

RewriteEngine on

RewriteCond %{HTTP_HOST} ^www.yoursitename.com [NC]
rewritebase /

RewriteRule ^$ index.php [L]
RewriteRule ^index index.php [L]
RewriteRule ^aboutus  aboutus.php [L]
Jump to Post

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>
Jump to Post

All 6 Replies

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>

try this one.

RewriteRule (.*) $1.php
RewriteRule ^(.*)\$ /$1.html [R=301,L]
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.