Skip navigation
Ahir Nitesh
Currently Being Moderated

Problem in .htaccess redirection setup

Oct 6, 2011 3:37 AM

Tags: #.htaccess_redirection_problem

Hello Friends,

 

I am not sure weather this is appropriate place to raise this question or not.

 

I have a website www.esparkinfo.com, It is in core PHP, I want to hide php extension and display html extension to my visitors and I did it by changing in .htaccess file.

Below is the .htaccess code I used to access php file with .html extension

 

RewriteRule ^(.*)\.html$ $1.php

 

Now the problem is, I can access same file with both extensions like /services.php file access from /services.php and /services.html

 

I want to set redirection to .html if visitor type .php extension but I am failed to do so, I have appplied many logic but it gives me "500 internal server error".

 

I really apppriciate your suggestions and help.

 
Replies
  • Currently Being Moderated
    Sep 21, 2012 5:42 AM   in reply to Ahir Nitesh

    I am So Sorry Mr. Nitesh for that I also got same problem in my website cheap web design company, It is also core PHP, And I want to show html extension to my visitors.

    I also search the real logic for my website.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 23, 2012 9:56 PM   in reply to johndouglas007

    I would imagine that the server config would matter, try adding this to the .htacess

    changes parse

     

    AddHandler x-httpd-php .html .htm

     

    let me know

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points