Jump to content

Help Understanding Re-write please


fry2010

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.