Jump to content

SaranacLake

Members
  • Posts

    648
  • Joined

  • Last visited

Everything posted by SaranacLake

  1. Obviously I'm not going to throw out my current code-base. And, as stated, I do want to learn MVC and OOP for v2.0
  2. If I had Git and I understood how to use it, you'd be 100% correct. I have "Dev" and "Prod". Learn OOP. Learn Git. That is where I hope to be in a couple of months... ("Learning", that is!)
  3. What I meant by "challenge" is that A LOT (e.g. 80-90%) of "OOP" developers ALSO don't "get" OOP, and they use frameworks as a crutch, which is why the majority of OOP code out in the world looks like crap and is in fact NOT "OOP". (Just as "The Gang of Four"...) I did the best I could with the resources that I had. i would have given my right arm if I could have "got" OOP, but it wasn't meant to be. IF I can get my website done, then the next step I hope to take is take one final swing at learning OOP before I die. 😉
  4. If I recall correctly, you could just insert a 'dummy" index.php file in every directory, right? Currently I have this code in my .htaccess in the public_html folder... Options -Indexes ErrorDocument 403 "/utilities/access-denied.php" Shouldn't that first line of code have prevented getting a directory listing like I was seeing when i renamed "index.php" to "news-index.php"? And wouldn't that second line handle the 403 error if I made whatever change I need to not require the "index.php" as the default file in every directory? I honestly don't recall how I broke things this weekend - i had like 20+ tabs open and was doing a little of everything trying to get this site up. But I know the directory listing threw me off, and now that i think about it, it seems to me that I WAS getting a 403 error because I couldn't figure out a way to test out my "access-denied.php" error-handling file, and then I accidentally caused a 403. I do know that I had to reboot to get things to behave normally. At any rate, with the code I listed above, what do i need to do if... 1.) I want to make "news-index.php" the default file in the "news" folder? 2.) How can I make my URL pretty and so "http://www.domain.com/news/news-index.php" will be rewitten as "http://www.domain.com/news/"
  5. @requinix, You posted in the wrong thread! (And I replied in the wrong thread too!) *LOL* Back to tis thread, it sounds like I included my < head > code the correct way.
  6. Well, for now, I'll just leave things as is - I have this thing for "pretty URLs", but whatever. If I hover, I think I can see the path, but its just a pain when you have 25 tabs open - which i usually do.
  7. Again, this is for my *temporary* website so I can get content onine while I finish (and fix) my larger "real" website. The goal is to make my temporary website EASY to develop, and I have decided that having a half-a-dozen directories all with "index.php" is confusing. So how can I tell MAMP that if a directory doesn't have an "index.php" file in it, then that is okay?
  8. It seems to work okay for the last few days, and my web pages pass the W3C validator. But when I staretd this thread, i wasn't sure if it was correct or not. (I hate writing crappy code?!)
  9. A-ha... So I think you are saying that my instance of MAMP is expecting that every directory has an "index.php" file in it? Can I disable that feature? I understand your suggestion to have all of my files be "index.php", but as mentioned, it makes working with them in NetBeans to be a pain. And the last thing I need to to spend a bunch of time updating a file only to find out it is the wrong "index.php"?! (Once I get my "real" website up and running, this is less of an issue since that one is database driven. But for my temproary site, I am just using straight-up hard-coded php files with not databse.) So can I turn of the requirement that every directory needs an "index.php" file? And if I do that, are there any downsides?
  10. In index.php I have... <?php $htmlTitle = "My page specific title here"; ?> <!DOCTYPE HTML> <html lang="en"> <?php require_once('../../coponents/html_head.php'); ?> and so on... And then in my "head_html.php" file I have... <head> <meta blah blah? <title><?php echo (isset($htmlTitle) ? $htmlTitle : "DEFAULT_TEXT_HERE") ?></title> <link blah blah> </head> So is that okay?
  11. I had started to do that, but realized it was really confusing when I had several tabs open in NetBeans that all said "index.php" So what was wrong with my mod_rewrite above?
  12. In the past I had the following code to remove the "index.php" portion of a URL to transform this "www.domain.com/index.php" to this "www.domain.com/" This is what I used... RewriteCond %{REQUEST_URI} ^.*/index\.php RewriteRule ^(.*)index.php$ $1 [L,R=301] This seemed to work okay, but ow i have expanded my temporary website. Now I have the following set up... www.company.com/index.php www.company.com/news/news-index.php www.company.com/news/economy/economy-index.php What I want in the address bar is this... www.company.com/ www.company.com/news/ www.company.com/news/economy/ I tried modifying the above cod eliek this, but something I did - not sure what - ending up giving me very weird page loads where iw as seeing a directory listing, and I ultimately had to comment out my code and reboot?! What do I need to do to fix things? I have tis original code... RewriteCond %{REQUEST_URI} ^.*/index\.php RewriteRule ^(.*)index.php$ $1 [L,R=301] and then I tried adding this a few lines down... RewriteCond %{REQUEST_URI} ^.*/news-index\.php RewriteRule ^(.*)news-index.php$ $1 [L,R=301] RewriteCond %{REQUEST_URI} ^.*/economy-index\.php RewriteRule ^(.*)economy-index.php$ $1 [L,R=301] Thanks.
  13. I wasn't sure if including my html_head.php file would work, because that file has this line of code... <title><?php echo (isset($htmlTitle) ? $htmlTitle : HTML_TITLE_DEFAULT) ?></title> So I wasn't sure if that would be considered "recursive" and break things, since you are including the file using PHP and then calling PHP from within that file to echo something.
  14. I am working on a temporary mobile site while I try and fix my main site. As I do this, I am trying to look at better ways to code. Is there any problem/danger to including the HTML Head? Since this block of code repeats - except for the < title > - I figure why code it multiple times. I was thinking of using an INCLUDE on this... <head> <!-- METADATA --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width", height="device-height", initial-scale=1> <!-- TITLE --> <title>$title</title> <!-- STYLES --> <link type="text/css" rel="stylesheet" href="css/styles.css" /> </head> Thoughts?
  15. Let me rephrase what I was asking. If this was my website being listed in Google.... And let's say that I changed where "History of Basketball" was physically listed in my public_html folder, and thus the URL would change, would that end up changing how the search results (like abive) looked, and would it hurt where my website or web page ranked in Google? If the example above wouldn't change, but when you clicked on "History of Basketball", then nothing lost. But if by re0organizing my site, if that hurt my website's page rank or even changed how the search results looked, then that would be good to know in advance. Hope that makes more sense?
  16. Do you know if the Google listing will remain the same (i.e. same search description) and the only thing that will change are the links that people are taken to? Or will Google treat the new page like an entirely new entry? I am trying to plan things out so they don't change, but you can't always make things entirely scalable.
  17. So if I re-organize things, then just create an entry in my .htaccess file and that will solve things? Will Google penalize me for changing things around?
  18. If I have a web page located here: www . company . com / how-to-repair-your-computer.html And I decide to re-structure my website like this www . company . com / articles / how-to-repair-your-computer.html How do I make sure that people don't search and end up at the old, now broken, link? It seem inevitable that as a website grows, that you will want to re-organize things. What is the best way to make sure that anyone who searches or clicks on an old link - say from an email from a friend - doesn't get a 404 error? Also, how do you avoid ruining a web pages rank on Google after you move things? (I think if the URL changes, Google makes you start all over as far as getting listed on page-1 and all of that? Is this something I have to hande on my end, or is it a Google issue, or something else?
  19. I believe that NetBeans has Subversion but into it. I think I have used that to "undo" a given PHP file, but I'm not sure it works at a project level like you'd normally do with a normal configuration mgt tool.
  20. So then I guess it is best to name my PHP and HTML files what works best for me then, right? (On this temporary site, for speed, I am just doing manual pages - with no PHP or database-driven content - to create things, and I have come up with a naming convention to more easily organize things. For instance, I am publishing a lot of tables with data, so having a naming convention will make it easier for me to find and update stuff while I , in parallel, finish my real site.)
  21. Not sure where to post. For my temporary website, I am trying to figure out the best way to name HTML files. I read that Google gives you points for naming image files after what they are (e.g. "dinosaur.jpeg"). Does the same apply to HTML (and PHP) files? For instance, would there be any benefit as far as SEO goes if a file was named this... a.) "table-20-005-unemployed-workers-by-state.html" b.) "table-20-005.html" c.) "123456.html"
  22. This. This. Well, nobody knows more about shipping a piece-of-crap than Microsoft! *LMAO* I am aiming higher than that, BUT, I should probably give up on perfection too! This. I think I know how the people working on BetaMax felt... 😉
  23. True, but my biggest issue is that my website looks like a newspaper - with 3 columns - and the assumption that people have AT LEAST 15-inch screens. My website is horizontal. The modern world is vertical and requires both scrolling, and intelligent design to know when to add/subtract things (e.g. hamburger menus). My site was designed well for 8-10 years ago, but i was too slow to publish it, and now it is outdated. If I could ever understand MVC, OOP, and GiT I could jump light-year ahead. My code runs well and is solid, but it is a bitch to update, and because how I code, it is not "agile". And please don't anyone say, "Oh, MVC, OOP, and GiT are easy." If they werre easy to learn - for ME - then I would have used them 10 years ago. (Well, i suppose GiT isn't too hard.) But I haven't given up, and I hope to master MVC and OOP and mobile in v2.0 of my life!!!
×
×
  • 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.