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
Related Q & A:
- How To Mod Dead Island?Best solution by Yahoo! Answers
- How to rewrite URL in HTTPS?Best solution by Server Fault
- How can I do nginx rewrite?Best solution by Server Fault
- How to rewrite URL using htaccess?Best solution by Stack Overflow
- How to rewrite a URL using htaccess?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.