| | |||||
| ||||||||
| Website Development Development concepts, scripts, sponsors and affiliate programs. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Account Suspended Join Date: Jan 2008 Location: Stafford
Posts: 993
![]() ![]() ![]() ![]() ![]() ![]() ![]() | Mod_Rewrite help? Hi, I am trying to achieve the following: games.php can be accessed via /games. So somebody goes to http://website.com/games and they will be shown, games.php or they would go to http://website.com/food and will be shown food.php Is this possible? If so, how? |
| |
| | #2 (permalink) |
| NamePros Webmaster ![]() ![]() ![]() Join Date: Feb 2003
Posts: 12,930
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Do you only have a couple of specific pages, or do you want to wildcard it so /anything goes to /anything.php? Assuming the former, you can do that by adding this to your .htaccess: ????: NamePros.com http://www.namepros.com/website-development/462694-mod_rewrite-help.html Code: RewriteEngine On RewriteRule ^games /games.php RewriteRule ^food /food.php If you wanted to prevent this by adding a slash to the end of the URL, you could do this: RewriteRule ^games/ /games.php Then you make to make sure your link is to /games/ and not just /games |
| |