Jump to content

jdubwelch

Members
  • Posts

    85
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jdubwelch's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. I used to have many many (like 90 redirects). But that crashed the server. So I need to figure out a new way to do this. My old redirects is this: <IfModule mod_rewrite.c> # Enable mod_rewrite RewriteEngine On # Permalinks# Rewrite Rules for OregonRewriteRule ^NCAA/Pac-10/Oregon-Ducks/$ index.php?teamID=1RewriteRule ^NCAA/Pac-10/Oregon-Ducks/page/([0-9]+)/ index.php?teamID=1&page=$1RewriteRule ^NCAA/Pac-10/Oregon-Ducks/category/([0-9])/.*/page/([0-9])/ categories.php?teamID=1&catID=$1&page=$2RewriteRule ^NCAA/Pac-10/Oregon-Ducks/category/([0-9]+)/ categories.php?teamID=1&catID=$1RewriteRule ^NCAA/Pac-10/Oregon-Ducks/source/([0-9]+)/.*/page/([0-9])/ sources.php?teamID=1&sourceID=$1&page=$2RewriteRule ^NCAA/Pac-10/Oregon-Ducks/source/([0-9]+)/ sources.php?teamID=1&sourceID=$1RewriteRule ^NCAA/Pac-10/Oregon-Ducks/date/([0-9]{4}\-[0-9]{2}\-[0-9]{2})/.*/page/([0-9])/ date.php?teamID=1&date=$1&page=$2RewriteRule ^NCAA/Pac-10/Oregon-Ducks/date/([0-9]{4}\-[0-9]{2}\-[0-9]{2})/ date.php?teamID=1&date=$1RewriteRule ^NCAA/Pac-10/Oregon-Ducks/popular/page/([0-9]+)/ popular.php?teamID=1&page=$1RewriteRule ^NCAA/Pac-10/Oregon-Ducks/popular/ popular.php?teamID=1RewriteRule ^NCAA/Pac-10/Oregon-Ducks/contribute/ contribute.php?teamID=1RewriteRule ^NCAA/Pac-10/Oregon-Ducks/contribute-feed/ contributeFeed.php?teamID=1RewriteRule ^NCAA/Pac-10/Oregon-Ducks/m mobile.php?teamID=1RewriteRule ^NCAA/Pac-10/Oregon-Ducks/([0-9]+)/ headline.php?teamID=1&id=$1... times 90 (one set for each team) ...</IfModule> As you can see there a "dummy" folder structure /NCAA/Pac-10/Oregon-Ducks that is loading the root directory file index.php?teamID=1 I'm told by my server admins that I can't have that many in one htaccess file, So i'm trying to figure a way around this. I was thinking of creating the folder structure for each team and having the htaccess file in that folder creating the redirects back to the root directory. But I don't know how to do that. i tried: <IfModule mod_rewrite.c> # Enable mod_rewrite RewriteEngine On# Rewrite Rules for OregonRewriteRule ^NCAA/Pac-10/Oregon-Ducks/$ ../../../index.php?teamID=1 # End Permalinks</IfModule> but that didn't work. Here's the structure if it helps: php_value include_path ".:/Applications/MAMP/htdocs/projects/oneclicksportsnow/trunk/html/" Inside /html/ are all my working files that read in and display dynamic data based on teamID (ie index.php, categories.php, sources.php, etc) I then would have: /html/NCAA/Pac-10/Oregon-Ducks/.htaccess Directing everything back to the root.
  2. I guess I'm still confused. With your method, how would I tell the script what teamID it is? Here's a link to all rewrites i will need..... http://oneclicksportsnow.com/tmp/htaccess.php to do. I'm not sure if i can just do a regex for the whole url... because i've got to include the teamID for each one. I noticed with yours you have teamID=$1, but how will that send the teamID to the script?
  3. So here are more examples of teams (these are just for the index page not all the other pages though): RewriteRule ^NCAA/Big-12/Colorado-Buffaloes/$ index.php?teamID=12 RewriteRule ^NCAA/Big-12/Texas-Longhorns/$ index.php?teamID=20 RewriteRule ^NCAA/Big-10/Ohio-State-Buckeyes/$ index.php?teamID=30 RewriteRule ^NCAA/SEC/Florida-Gators/$ index.php?teamID=37 The only variable I need is the teamID to make the page display correctly. However, I want the url structure to be based on that team info. Which is <sport>/<conference>/<team>/ So rather that /index.php?teamID=12... I want the sport/conference/team/.
  4. For this project I'm working on, I need to create friendly URLs using mod_rewrite. This is what I've generated to create the create links: RewriteRule ^NCAA/Pac-10/Oregon-Ducks/$ index.php?teamID=1 RewriteRule ^NCAA/Pac-10/Oregon-Ducks/page/([0-9]+)/ index.php?teamID=1&page=$1 RewriteRule ^NCAA/Pac-10/Oregon-Ducks/category/([0-9])/.*/page/([0-9])/ categories.php?teamID=1&catID=$1&page=$2 RewriteRule ^NCAA/Pac-10/Oregon-Ducks/category/([0-9]+)/ categories.php?teamID=1&catID=$1 RewriteRule ^NCAA/Pac-10/Oregon-Ducks/source/([0-9]+)/.*/page/([0-9])/ sources.php?teamID=1&sourceID=$1&page=$2 RewriteRule ^NCAA/Pac-10/Oregon-Ducks/source/([0-9]+)/ sources.php?teamID=1&sourceID=$1 RewriteRule ^NCAA/Pac-10/Oregon-Ducks/date/([0-9]{4}\-[0-9]{2}\-[0-9]{2})/.*/page/([0-9])/ date.php?teamID=1&date=$1&page=$2 RewriteRule ^NCAA/Pac-10/Oregon-Ducks/date/([0-9]{4}\-[0-9]{2}\-[0-9]{2})/ date.php?teamID=1&date=$1 RewriteRule ^NCAA/Pac-10/Oregon-Ducks/popular/.*/page/([0-9])/ popular.php?teamID=1&page=$2 RewriteRule ^NCAA/Pac-10/Oregon-Ducks/popular/ popular.php?teamID=1 RewriteRule ^NCAA/Pac-10/Oregon-Ducks/contribute/ contribute.php?teamID=1 RewriteRule ^NCAA/Pac-10/Oregon-Ducks/([0-9]+)/ headline.php?teamID=1&id=$1 There's 65 teams total though. That means I'd have to duplicate this code and have it in my .htaccess file 65 other times. The URL structure is based on team info determined by the teamID. Is there a better way to do this? With less code maybe? i read this article at sitepoint about the mapping feature of mod_rewrite (http://articles.sitepoint.com/print/guide-url-rewriting... that would essentially be what I want to do (a static file stores the ids and values as a lookup), but with my hosting company I don't have access to modifiy the httpd.conf file.
  5. Actual URL: http://localhost:8888/projects/oneclicksportsnow/html/layout.php?teamID=6 URL that I want to display: http://localhost:8888/projects/oneclicksportsnow/html/Pac10/Washington-State-Cougars/ I read a tutorial and this is what I've done. Modify httpd.conf RewriteMap teams txt:/projects/oneclicksportsnow/teamIDs.txt RewriteRule ^(.*)$ layout.php?teamID=${teams:$1|0} I have a text file saved as teamIDs.txt in the /oneclicksportsnow/ folder that is tab delimited like this: Pac10/Oregon-Ducks 1 Pac10/Oregon-State-Beavers 2 Pac10/Washington-State-Cougars 6 I restarted apache, typed this in "http://localhost:8888/projects/oneclicksportsnow/html/Pac10/Washington-State-Cougars/" and I get a 404 error. What am i missing?
  6. I have two arrays... $commonFields = array ('bed','bath','school'); $fieldNames = array ('Lisitng File #', 'Chain Y/N', 'Bedrooms', 'Half Baths', 'School District'); foreach ($fieldNames as $field) { // Find match in $commonFields } I was thinking using in_array but i need something more i need it to out put: Bedrooms, Half Baths, and School District
  7. I'm working on a project that is going to be on a bigger scale than I've ever done. I'm going to have about 65+ different pages all with the same template (or look), with different color schemes & content. Each page will run the same script, but display different content that is being queried from a MySQL Database based on an id. There will be a lot of content on the page that is coming from the DB. My question is... since they're all the same basic "template" do I just have that one file and read in the id to make them different. (ie... 1 file for 65 pages like index.php?id=45) OR set up a whole folder structure for each 65 pages. which would be something like this: NCAA index.php PAC-10 index.php OREGON-DUCKS index.php OREGON-STATE-BEAVERS index.php (times 8 more teams) SEC index.php FLORIDA-GATORS index.php LSU-TIGERS index.php (times 10 other teams) (times 12 other conferences) index.php in the example above would be the same except it's reading a different id. I know the folder structure would be overkill, but say each of the 65 pages are being looked at at the same time. Wouldn't that slow the scripts and page load down?
  8. I read some stuff and copied it, but I'm getting a 500 error. existing url: headline.php?headline=$headline_id&title=$headline_title rewrite to: headline/$headline_id/$headline_title/ this is my rewrite that errors out: RewriteRule ^headline/([0-9]+)/[A-Za-z0-9-]+)/?$ headline.php?headline=$1&title=$2 [L]
  9. Is it possible to have a pop up window pop up when a user leaves my website or home page to a different site? If so, how would you do it? Javascript is clientside and I'm assuming you would use javascript to do that.
  10. I'm trying to read in a rss feed and use it in my own php rss parser. I'm reading in a lot of feeds, but some don't work. I have an application on my computer called netNewsWire that reads tons of RSS feeds. I copied the feed url into my code and it errors out. When I type in the url into my browser nothing shows up as well. Is there a way to read it? or is that some security type thing so I can't do anything with it? an example url i'm trying to read in is: http://www.gazettetimes.com/?rss=sports/beaver_sports/football I don't know if you need to see my code or not, I can post it if you want or you can see it at: http://www.jwelchdesign.com/rssDMX-code.txt and this is the page that runs the script: you'll see that it errors out because it can't read anything in. http://www.jwelchdesign.com/rssDMX.php
  11. I host through mediatemple.net. I searched their support page for vhost and aliases and nothing relevant came up. I'm not to saavy with the "server" stuff. Is there a book on that or something I could read up on? Currently, I have a "main" site folder that uses $_GET to read in the $team_id variable. That's all I need to be read in and it works. However, the new version of the site i'm working on has session (user login/logout), and it's not working. So I'm going back to square one here.
  12. We have a site that (at it's most basic level) displays a bunch of news links for a sports team all from a database. Currently there are three teams that we are displaying news for. They're all the same website, except logos, colors, etc. They all have different domains, but are on the same server. What's the best way to get set this up? We may expand and have three times the sites that we have.
  13. I have two files: file #1: index.php <?php $team_id = 1; include ("test.php"); ?> file #2: test.php <?php global $team_id; echo "$team_id"; ?> I need (in the most basic form, $team_id to be a variable in test.php), however this method doesn't work. Suggestions?
×
×
  • 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.