Kevin Murphy
Kevin Murphy

Reputation: 408

Simple Mod_rewrite

For some reason, all of the documentation for mod_rewrites I could find across the web were dealing with large queries, etc. I would just like to have a user enter in:

http://domain.com/page/faq  

where they would be accessing just /faq.php

Sorry for my inexperience, but I hope you'll forgive me! Thanks, Kevin

Upvotes: 0

Views: 75

Answers (2)

Michael Rice
Michael Rice

Reputation: 1183

If you want only faq

RewriteRule ^page/faq.php faq.php

Otherwise Ignacio has the better solution.

Upvotes: 1

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798716

Put this rule in .htaccess in your document root, adding flags as necessary:

RewriteRule ^page/(.*) $1.php

Upvotes: 1

Related Questions