fry2010 Posted February 19, 2011 Share Posted February 19, 2011 Ok so I basically have a structure like: www.mysite.com/location/a-name.php www.mysite.com/location/a-different-name.php www.mysite.com/location/another-different-name.php Now I want these all to point to one file of .php so that I can output stuff from mysql for each of the different name files. BUT I want to keep the names of the files in the URl. An example: I have the 3 links to those pages in www.mysite.com/location/index.php A person clicks the link to: www.mysite.com/location/a-name.php It takes them to that location, but uses a file called: www.mysite.com/location/grab-mysql-data.php This is so that when I eventually create another new page, I will not have to physcially make a new php page, I can just store the data in mysql and it will get pulled automatically and presented like all the other pages. Make sense? I know that you will suggest mod_Rewrite but I cant see how mod_Rewrite will work in this case, unless you are able to make apache grab information from a mysql database. Link to comment https://forums.phpfreaks.com/topic/228201-help-understanding-re-write-please/ Share on other sites More sharing options...
fry2010 Posted February 19, 2011 Author Share Posted February 19, 2011 Dont worry I have decided it is probably best I just create a new php file for each time I want to do a new page and just call a function. The reason I wanted to do this in the first place was just for ease of updating the site, but tbh its easy enough to just create a new page with one different parameter. Link to comment https://forums.phpfreaks.com/topic/228201-help-understanding-re-write-please/#findComment-1176766 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.