Posts

Apache: keep track of non-404 errors (e.g., 403, 500, et al)

Apache: keep track of non-404 errors (e.g., 403, 500, et al) - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about php, htaccess, , , .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : In cpanel I always have the error log open ("This function will display the last 300 errors for your site.") which is nice for 404's but what about the rest? I'm working on a few things in htaccess, such as this: RedirectMatch 403 /($|*)/?$ So now when I try any URL with a dollar-sign or an asterisk in it, bam, 403 forbidden; perfect. S...

htacess seems to make the page load forever

htacess seems to make the page load forever - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about web-hosting, php, htaccess, , .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I need to rewrite a URL of my server so the URL looks friendly. Like: site.com/var1/var2/var3/... to site.com/index.php?page=var1/var2/var3/... So I wrote this .htacess: RewriteEngine On RewriteRule ^.*$ index.php?page=$1 [NC,L] But when I upload it to the server, and try to load a page, the page loads forever! What am I doing wrong? Solution : RewriteRule ...

Inserting WordPress in a site with .htaccess Rewrite Rule

Inserting WordPress in a site with .htaccess Rewrite Rule - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about php, htaccess, web-development, wordpress, .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I want to insert a WordPress blog in a website which is programmed in PHP and that uses includes() to select what content to show, and that uses .htaccess Rewrite Rule to get friendly URLs. The problem is that when installing WordPress in a subdirectory the rewriteRule executes and doesn't let the user get to the subdirectory wher...

Is there an API or programmatic way to convert ".htaccess" rewrites to "web.config" IIS Rewrites?

Is there an API or programmatic way to convert ".htaccess" rewrites to "web.config" IIS Rewrites? - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, iis, url-rewriting, , .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I know I can do it in IIS Manager, but I am looking for some programmatic way to do it. We need to do this for customer all the time. So it would be great if there's a programmatic way of doing so. Solution : There isn't a reliable programmatic way to automatically convert ...

Switch to https

Switch to https - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about apache, htaccess, mod-rewrite, , .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I'm looking to use an .htaccess file to use mod_rewrite to switch the protocol from http:// to https:// when someone hits my website. For instance, once someone goes to: http://www.mywebsite.com/ I'd like the browser to switch to: https://www.mywebsite.com/ The same goes for the http://mywebsite.com/ -> https://mywebsite.com This is the following code I've been using an...

Link to pages on site without .html extension appearing in browser?

Link to pages on site without .html extension appearing in browser? - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, redirects, url, mod-rewrite, .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I've modified my .htaccess file to allow access to html files without having to include the extension on the end, for example: www.mysite.com/document directs to www.mysite.com/document.html However, when I want to link to pages within my site using something like <a href="page.html"></a> I still get t...

Htaccess RewriteCond based on environment variable

Htaccess RewriteCond based on environment variable - .htaccess  files are  extremely useful  in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug  .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, apache, mod-rewrite, custom-variables, .htaccess  common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your  .htaccess file running smoothly. Problem : I find apache very unfriendly. Anyway. I have this: RewriteRule (.*) - [QSA,E=DOMAIN_NAME:localhost.com] This doesn't redirect, which is fine: RewriteCond "www.%ENV:DOMAIN_NAME" "!=www.localhost.com" RewriteRule ^ https://%HTTP_HOST?err=%ENV:DOMAIN_NAME [L,R=301] This doesn't redirect, which is fine: Rewrite...