NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Website Development
Reload this Page Mod_Rewrite help?

Website Development Development concepts, scripts, sponsors and affiliate programs.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 04-27-2008, 01:42 PM THREAD STARTER               #1 (permalink)
Account Suspended
 
squid's Avatar
Join Date: Jan 2008
Location: Stafford
Posts: 993
squid is a splendid one to beholdsquid is a splendid one to beholdsquid is a splendid one to beholdsquid is a splendid one to beholdsquid is a splendid one to beholdsquid is a splendid one to beholdsquid is a splendid one to behold
 


Special Olympics Myanmar Relief

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?
squid is offline  
Old 04-28-2008, 02:10 AM   #2 (permalink)
RJ
NamePros Webmaster


 
RJ's Avatar
Join Date: Feb 2003
Posts: 12,930
RJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatness
 



Find Marrow Donors! Cystic Fibrosis Parkinson's Disease
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
The danger in this is that any URL containing the word games will get sent to that games.php file. For instance /games12345 will also go to the same page.

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
RJ is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 09:19 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger