How to mod rewrite for sitemap.xml?

Mod Rewrite question?

  • Hello, I am currently learning how to use mod rewrite and would like to create a very simple RewriteRule but for some reasons seems impossible. I have tackled with this problem with quite some time and read at least 10 tutorials but for some reasons I still can't create the rule. I simply have two php pages. One called contact.php and the second called about.php. I simply would like the pages to be renamed contact and about. Simply removing the php trailer. Here is the what I thought would work. RewriteRule ^([a-z]+)$ /$1 [L] Below are other combinations I tried RewriteRule ^([a-z]+)$ $1 [L] (no slash before $1) RewriteRule ^(.*)$ /$1 [L] ... I tried more combinations but really there is no point of writing them all. Any ideas. Thanks in advance. By the way mod rewrite works on my server. I use it to rewrite www.example.com to example.com

  • Answer:

    If you were to leave the file without a .php it would result in an error. removing the .php doesn't tell the browser where on the server the type of file to look for, plus user could change this and add .htm, .cfm etc. and then it would result in an error.

George at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.