I used following code for hiding .php extension but mail() function stopped working. What is the problem?

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L,NC]


RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_URI}.php [L]

Mail function & redirect

    mail($to,$subject,$message,$headers);       
    header('Location: http://xyz.com/');
Re: .htaccess problem 80 80

Can you show the error you getting?

IF possible try this it may work out-

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [L]
Re: .htaccess problem 80 80
RewriteEngine on

RewriteCond $1 !^(index\.php|assets|css|js|images|ckeditor|uploads|swf|fonts|theme|robots\.text|get_capcha\.php|ajax|img|prettify)
RewriteRule ^(.*)$ /your project name/index.php/$1 [L]
Be a part of the DaniWeb community

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