Join David Powers for an in-depth discussion in this video Increasing the log level to troubleshoot problems, part of PHP: Clean URLs on Apache Server.
- [Voiceover] A course like this presents a rather…rosy view of Apache mod rewrite.…All the rewrite rules have worked flawlessly.…That's because I tested them before recording,…and I spared you the agony of watching all my mistakes,…and I can assure you there were plenty of them.…Let's create a deliberate mistake…in one of the rewrite rules and see…what we can do to troubleshoot it.…The rewrite rule I'm going to change is on line six.…I'm just going to remove the .php before the query string.…So, I'll save that, then go to the browser.…
Click fresh flowers.…That page loads okay.…If I click one of these images here, we get Error 404.…Object not found.…The requested URL was not found on this server.…Please inform the author of that page about the error.…Well that's not very helpful at all.…Let's see if we can get more information…by looking inside the Apache error log.…In my testing environment I can use the XAMPP control panel…to select logs, and then Apache error.log.…
In other systems, you can find it in the Apache logs folder,…
Rather than checking URLs individually, David shows how to evaluate and update them sitewide with the Apache mod_rewrite module. Watch these tutorials to learn how to enable mod_rewrite on your server, understand the structure of mod_rewrite rules, remove unnecessary file extensions, convert query strings into readable numbers and text, and use rewrite maps to look up complex values without regular expressions. Plus, learn how to enhance search results and provide searchers with links to specific parts of a webpage.
- Checking your Apache setup
- Creating simple regular expressions
- Removing .php from URLs
- Replacing query strings
- Displaying clean URLs in search results
- Linking to parts of a webpage
- Creating a clean URL for any PHP file