{"id":224,"date":"2011-10-02T17:24:52","date_gmt":"2011-10-03T00:24:52","guid":{"rendered":"http:\/\/virendrachandak.wordpress.com\/?p=224"},"modified":"2014-10-12T11:20:59","modified_gmt":"2014-10-12T18:20:59","slug":"htaccess-tips","status":"publish","type":"post","link":"https:\/\/www.virendrachandak.com\/techtalk\/htaccess-tips\/","title":{"rendered":".htaccess tips"},"content":{"rendered":"<p>Topics Covered:<\/p>\n<ul>\n<li><a title=\".htaccess tips\" href=\"http:\/\/www.virendrachandak.com\/techtalk\/\/htaccess-tips\/#what_is_htaccess\">What is .htaccess file?<\/a><\/li>\n<li><a href=\"http:\/\/www.virendrachandak.com\/techtalk\/\/htaccess-tips\/#when_to_use_htaccess\">When to use .htaccess file?<\/a><\/li>\n<li><a href=\"http:\/\/www.virendrachandak.com\/techtalk\/\/htaccess-tips\/#htaccess_disadvantages\">Disadvantage of using .htaccess file<\/a><\/li>\n<li><a href=\"http:\/\/www.virendrachandak.com\/techtalk\/\/htaccess-tips\/#htaccess_authentication\">Authentication using .htaccess file<\/a><\/li>\n<li><a href=\"http:\/\/www.virendrachandak.com\/techtalk\/\/htaccess-tips\/#custom_error_documents\">Custom Error Document<\/a><\/li>\n<li><a href=\"http:\/\/www.virendrachandak.com\/techtalk\/\/htaccess-tips\/#prevent_dir_listing\">Allow\/Disallow Directory Listings<\/a><\/li>\n<\/ul>\n<div id=\"what_is_htaccess\">\n<h3>What is .htaccess file?<\/h3>\n<p>.htaccess file is used on Apache Web Server to make configuration changes on per-directory basis. This file contains the configuration directives and are applied to the directory and all its sub directories. The configuration directives in .htaccess files may overwrite the directives in any .htaccess file found higher up in the directory tree and even the main server configuration.<\/p>\n<p>To enable use of .htaccess file the <strong>AllowOverride<\/strong> Directive has to be set in the Apache Server configuration.\n<\/div>\n<p><!--more--><\/p>\n<div id=\"when_to_use_htaccess\">\n<h3>When to use .htaccess file?<\/h3>\n<p>.htaccess file should be used when the main server configuration file cannot be accessed or modified. It is always best to use the server configuration files over .htaccess files.<\/p>\n<p>.htaccess files are used when some configurations are to be made on per-directory basis. Also, it can be used to redirect users from old site to new site or old pages to new pages.<\/p>\n<\/div>\n<div id=\"htaccess_disadvantages\">\n<h3>Disadvantages of using .htaccess files<\/h3>\n<ul>\n<li><strong>Performance<\/strong>: Every time a document is requested apache has to look for the .htaccess files in the directory and each directory higher up in the document tree till the root directory. All these files may or may not exists, but the server still has to try to fetch them and apply all the directives to the file being fetched.<\/li>\n<li><strong>Security<\/strong>: Mis-configuration of directives in the .htaccess files can cause issues for the document inside the directory and all sub-directories.<\/li>\n<\/ul>\n<\/div>\n<div id=\"htaccess_authentication\">\n<h3>Authentication using .htaccess file<\/h3>\n<p>.htaccess file can be used to password protect a directory on the server. To password protect the directory first we will need to create a .htpasswd file. This file can be generated using any .htpasswd file generator or use the htpasswd command in Apache. e.g. to create a .htpasswd file for user &#8220;testuser&#8221; with password &#8220;testpassword&#8221; use the following command<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nhtpasswd -c \/usr\/local\/var\/www\/html\/.htpasses testuser\r\n<\/pre>\n<p>This will ask you for the password 2 times.<\/p>\n<p><span style=\"text-decoration:underline;\"><strong>Note<\/strong><\/span>: The above command will work only if the Apache bin folder is in your PATH, else you will have to cd into that directory and then execute the above command.<\/p>\n<p>This command would be executed as<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nhtpasswd -c \/usr\/local\/var\/www\/html\/.htpasses testuser\r\nNew password: testpassword\r\nRe-type new password: testpassword\r\nAdding password for user testuser\r\n<\/pre>\n<p>After creating the htpasswd file we will add the following to the .htaccess file<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nAuthType Basic\r\nAuthName &quot;restricted area&quot;\r\nAuthUserFile \/usr\/local\/var\/www\/html\/.htpasses\r\nrequire valid-user\r\n<\/pre>\n<\/div>\n<div id=\"custom_error_documents\">\n<h3>Custom Error Document<\/h3>\n<p>You might want to show users a custom error page instead of the default Apache error page. It is always a good idea to have custom error page rather than the standard Apache errors. The following code can be used to show the custom error page.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# custom error documents\r\nErrorDocument 401 \/401.php #Unauthorized\r\nErrorDocument 403 \/403.php #Forbidden\r\nErrorDocument 404 \/404.php #Not Found\r\nErrorDocument 500 \/500.php #Internal Server Error\r\n<\/pre>\n<p><span style=\"text-decoration:underline;\"><strong>Note<\/strong><\/span>: The path to the error documents are relative paths from the web directory<\/p>\n<\/div>\n<div id=\"prevent_dir_listing\">\n<h3>Allow\/Disallow Directory Listings<\/h3>\n<p>The files in a directory can be listed in browser if the directory does not contains the index file (typically index.html or index.php). To allow or disallow directory listings .htaccess file can be used.<\/p>\n<p><strong>Allow directory listings<\/strong>: Use the following directives<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nOptions +Indexes\r\n<\/pre>\n<p><strong>Disallow directory listings<\/strong>: Use any of the following directives<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nOptions -Indexes\r\n<\/pre>\n<p>or<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nIndexIgnore *\r\n<\/pre>\n<p><strong>Disallow certain file types from directory listings<\/strong>: Use the following directives to display all files except files with extension .jpg and .gif<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nIndexIgnore *.jpg *.gif\r\n<\/pre>\n<\/div>\n<div>These are only a few tips on .htaccess files. There are many more things like redirecting users to different pages, redirecting specific pages, URL starting in certain format, etc. can be achieved using .htaccess files. I will try to cover more .htaccess rules in my future posts.<\/div>\n<div><strong>Update<\/strong>: Check out my my next post on <a href=\"http:\/\/www.virendrachandak.com\/techtalk\/\/more-htaccess-tips\/\" target=\"_blank\">more .htaccess tips<\/a>.<\/div>\n<div>\n<p><strong>Related Articles<\/strong>:<\/p>\n<ul>\n<li><a title=\"Apache Tutorial: .htaccess files\" href=\"http:\/\/httpd.apache.org\/docs\/2.0\/howto\/htaccess.html\" rel=\"external nofollow\" target=\"_blank\">Apache Tutorial: .htaccess files<\/a><\/li>\n<li><a title=\".htaccess tips and tricks\" href=\"http:\/\/corz.org\/serv\/tricks\/htaccess.php\" rel=\"external nofollow\" target=\"_blank\">.htaccess tips and tricks<\/a><\/li>\n<li><a title=\"21 very useful htaccess tips &amp; tricks\" href=\"http:\/\/viralpatel.net\/blogs\/2009\/06\/21-very-useful-htaccess-tips-tricks.html\" rel=\"external nofollow\" target=\"_blank\">21 very useful htaccess tips &amp; tricks<\/a><\/li>\n<li><a title=\"Top 10 .htaccess Tips and Tricks\" href=\"http:\/\/edrackham.com\/apache\/top-10-htaccess-tips-and-tricks\/\" rel=\"external nofollow\" target=\"_blank\">Top 10 .htaccess Tips and Tricks<\/a><\/li>\n<li><a title=\".htaccess file\" href=\"http:\/\/www.htpasswdgenerator.com\/apache\/htaccess.html\" rel=\"external nofollow\" target=\"_blank\">.htaccess file<\/a><\/li>\n<\/ul>\n<\/div>\n<div><span style=\"text-decoration:underline;\"><strong>Note<\/strong><\/span>: I do not take responsibility for proper functioning of the above mentioned steps under all circumstances. If you download any files, programs from my blog then make sure you protect yourself. I am not responsible for any damages to your computer, website, blog, application or any thing else. I am not affiliated with or do not endorse any of the above mentioned sites.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Topics Covered: What is .htaccess file? When to use .htaccess file? Disadvantage of using .htaccess file Authentication using .htaccess file Custom Error Document Allow\/Disallow Directory Listings What is .htaccess file? .htaccess file is used on Apache Web Server to make configuration changes on per-directory basis. This file contains the configuration directives and are applied to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[6,8],"tags":[15,16,20,28],"class_list":["post-224","post","type-post","status-publish","format-standard","hentry","category-server-configuration","category-web-development","tag-htaccess","tag-htpasswd","tag-apache","tag-configuration-file"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>.htaccess tips - Virendra&#039;s TechTalk<\/title>\n<meta name=\"description\" content=\"In this post we will see what is a .htaccess file, when to use it, its advantages and disadvantages as well as some basic things that can be done using it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.virendrachandak.com\/techtalk\/htaccess-tips\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\".htaccess tips - Virendra&#039;s TechTalk\" \/>\n<meta property=\"og:description\" content=\"In this post we will see what is a .htaccess file, when to use it, its advantages and disadvantages as well as some basic things that can be done using it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.virendrachandak.com\/techtalk\/htaccess-tips\/\" \/>\n<meta property=\"og:site_name\" content=\"Virendra&#039;s TechTalk\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/virendrachandak\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/virendrachandak\" \/>\n<meta property=\"article:published_time\" content=\"2011-10-03T00:24:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-10-12T18:20:59+00:00\" \/>\n<meta name=\"author\" content=\"Virendra Chandak\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@virendrachandak\" \/>\n<meta name=\"twitter:site\" content=\"@virendrachandak\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Virendra Chandak\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.virendrachandak.com\\\/techtalk\\\/htaccess-tips\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.virendrachandak.com\\\/techtalk\\\/htaccess-tips\\\/\"},\"author\":{\"name\":\"Virendra Chandak\",\"@id\":\"https:\\\/\\\/www.virendrachandak.com\\\/techtalk\\\/#\\\/schema\\\/person\\\/63f7ffa1ea125e32af9618d188349e17\"},\"headline\":\".htaccess tips\",\"datePublished\":\"2011-10-03T00:24:52+00:00\",\"dateModified\":\"2014-10-12T18:20:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.virendrachandak.com\\\/techtalk\\\/htaccess-tips\\\/\"},\"wordCount\":761,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/www.virendrachandak.com\\\/techtalk\\\/#\\\/schema\\\/person\\\/63f7ffa1ea125e32af9618d188349e17\"},\"keywords\":[\".htaccess\",\".htpasswd\",\"Apache\",\"Configuration file\"],\"articleSection\":[\"Server Configuration\",\"Web Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.virendrachandak.com\\\/techtalk\\\/htaccess-tips\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.virendrachandak.com\\\/techtalk\\\/htaccess-tips\\\/\",\"url\":\"https:\\\/\\\/www.virendrachandak.com\\\/techtalk\\\/htaccess-tips\\\/\",\"name\":\".htaccess tips - Virendra&#039;s TechTalk\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.virendrachandak.com\\\/techtalk\\\/#website\"},\"datePublished\":\"2011-10-03T00:24:52+00:00\",\"dateModified\":\"2014-10-12T18:20:59+00:00\",\"description\":\"In this post we will see what is a .htaccess file, when to use it, its advantages and disadvantages as well as some basic things that can be done using it.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.virendrachandak.com\\\/techtalk\\\/htaccess-tips\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.virendrachandak.com\\\/techtalk\\\/htaccess-tips\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.virendrachandak.com\\\/techtalk\\\/htaccess-tips\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"TechTalk\",\"item\":\"https:\\\/\\\/www.virendrachandak.com\\\/techtalk\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Server Configuration\",\"item\":\"https:\\\/\\\/www.virendrachandak.com\\\/techtalk\\\/category\\\/server-configuration\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\".htaccess tips\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.virendrachandak.com\\\/techtalk\\\/#website\",\"url\":\"https:\\\/\\\/www.virendrachandak.com\\\/techtalk\\\/\",\"name\":\"Virendra's TechTalk\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.virendrachandak.com\\\/techtalk\\\/#\\\/schema\\\/person\\\/63f7ffa1ea125e32af9618d188349e17\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.virendrachandak.com\\\/techtalk\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.virendrachandak.com\\\/techtalk\\\/#\\\/schema\\\/person\\\/63f7ffa1ea125e32af9618d188349e17\",\"name\":\"Virendra Chandak\",\"logo\":{\"@id\":\"https:\\\/\\\/www.virendrachandak.com\\\/techtalk\\\/#\\\/schema\\\/person\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.virendrachandak.com\",\"https:\\\/\\\/www.facebook.com\\\/virendrachandak\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/virendrachandak\\\/\",\"https:\\\/\\\/x.com\\\/virendrachandak\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":".htaccess tips - Virendra&#039;s TechTalk","description":"In this post we will see what is a .htaccess file, when to use it, its advantages and disadvantages as well as some basic things that can be done using it.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.virendrachandak.com\/techtalk\/htaccess-tips\/","og_locale":"en_US","og_type":"article","og_title":".htaccess tips - Virendra&#039;s TechTalk","og_description":"In this post we will see what is a .htaccess file, when to use it, its advantages and disadvantages as well as some basic things that can be done using it.","og_url":"https:\/\/www.virendrachandak.com\/techtalk\/htaccess-tips\/","og_site_name":"Virendra&#039;s TechTalk","article_publisher":"https:\/\/www.facebook.com\/virendrachandak","article_author":"https:\/\/www.facebook.com\/virendrachandak","article_published_time":"2011-10-03T00:24:52+00:00","article_modified_time":"2014-10-12T18:20:59+00:00","author":"Virendra Chandak","twitter_card":"summary_large_image","twitter_creator":"@virendrachandak","twitter_site":"@virendrachandak","twitter_misc":{"Written by":"Virendra Chandak","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.virendrachandak.com\/techtalk\/htaccess-tips\/#article","isPartOf":{"@id":"https:\/\/www.virendrachandak.com\/techtalk\/htaccess-tips\/"},"author":{"name":"Virendra Chandak","@id":"https:\/\/www.virendrachandak.com\/techtalk\/#\/schema\/person\/63f7ffa1ea125e32af9618d188349e17"},"headline":".htaccess tips","datePublished":"2011-10-03T00:24:52+00:00","dateModified":"2014-10-12T18:20:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.virendrachandak.com\/techtalk\/htaccess-tips\/"},"wordCount":761,"commentCount":4,"publisher":{"@id":"https:\/\/www.virendrachandak.com\/techtalk\/#\/schema\/person\/63f7ffa1ea125e32af9618d188349e17"},"keywords":[".htaccess",".htpasswd","Apache","Configuration file"],"articleSection":["Server Configuration","Web Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.virendrachandak.com\/techtalk\/htaccess-tips\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.virendrachandak.com\/techtalk\/htaccess-tips\/","url":"https:\/\/www.virendrachandak.com\/techtalk\/htaccess-tips\/","name":".htaccess tips - Virendra&#039;s TechTalk","isPartOf":{"@id":"https:\/\/www.virendrachandak.com\/techtalk\/#website"},"datePublished":"2011-10-03T00:24:52+00:00","dateModified":"2014-10-12T18:20:59+00:00","description":"In this post we will see what is a .htaccess file, when to use it, its advantages and disadvantages as well as some basic things that can be done using it.","breadcrumb":{"@id":"https:\/\/www.virendrachandak.com\/techtalk\/htaccess-tips\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.virendrachandak.com\/techtalk\/htaccess-tips\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.virendrachandak.com\/techtalk\/htaccess-tips\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"TechTalk","item":"https:\/\/www.virendrachandak.com\/techtalk\/"},{"@type":"ListItem","position":2,"name":"Server Configuration","item":"https:\/\/www.virendrachandak.com\/techtalk\/category\/server-configuration\/"},{"@type":"ListItem","position":3,"name":".htaccess tips"}]},{"@type":"WebSite","@id":"https:\/\/www.virendrachandak.com\/techtalk\/#website","url":"https:\/\/www.virendrachandak.com\/techtalk\/","name":"Virendra's TechTalk","description":"","publisher":{"@id":"https:\/\/www.virendrachandak.com\/techtalk\/#\/schema\/person\/63f7ffa1ea125e32af9618d188349e17"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.virendrachandak.com\/techtalk\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.virendrachandak.com\/techtalk\/#\/schema\/person\/63f7ffa1ea125e32af9618d188349e17","name":"Virendra Chandak","logo":{"@id":"https:\/\/www.virendrachandak.com\/techtalk\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/www.virendrachandak.com","https:\/\/www.facebook.com\/virendrachandak","https:\/\/www.linkedin.com\/in\/virendrachandak\/","https:\/\/x.com\/virendrachandak"]}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2vTtQ-3C","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":255,"url":"https:\/\/www.virendrachandak.com\/techtalk\/more-htaccess-tips\/","url_meta":{"origin":224,"position":0},"title":"more .htaccess tips","author":"Virendra Chandak","date":"October 16, 2011","format":false,"excerpt":"In my previous post .htaccess tips I had started with what is .htaccess file and some things that can be done using it. In this post I'll cover more about .htaccess files. Topics Covered: Directory index file Redirection Preferred domain (www or non-www) Redirect old site to new site Redirect\u2026","rel":"","context":"In &quot;Server Configuration&quot;","block_context":{"text":"Server Configuration","link":"https:\/\/www.virendrachandak.com\/techtalk\/category\/server-configuration\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1421,"url":"https:\/\/www.virendrachandak.com\/techtalk\/big-forms-and-php-max_input_vars\/","url_meta":{"origin":224,"position":1},"title":"Big forms and PHP max_input_vars","author":"Virendra Chandak","date":"June 2, 2013","format":false,"excerpt":"Recently I was working in WordPress to create a big menu, with over 75 links in it. When I created it and tried to save it got save only partially, few menu items at the end got truncated. I was not sure what happened. So then I tried to add\u2026","rel":"","context":"In &quot;PHP&quot;","block_context":{"text":"PHP","link":"https:\/\/www.virendrachandak.com\/techtalk\/category\/php\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2196,"url":"https:\/\/www.virendrachandak.com\/techtalk\/using-php-bcrypt-algorithm-for-htpasswd-generation\/","url_meta":{"origin":224,"position":2},"title":"Generating bcrypt .htpasswd passwords using PHP","author":"Virendra Chandak","date":"September 23, 2019","format":false,"excerpt":"In my previous post we saw how to generate .htpasswd file using crypt and apr1-md5 algorithm in PHP. However, now there is a more secure BCRYPT algorithm that can be used since apache 2.4 for passwords in .htpasswd. In this post we will generate .htpasswd file using the BCRYPT algorithm\u2026","rel":"","context":"In &quot;Security&quot;","block_context":{"text":"Security","link":"https:\/\/www.virendrachandak.com\/techtalk\/category\/security\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1673,"url":"https:\/\/www.virendrachandak.com\/techtalk\/using-php-create-passwords-for-htpasswd-file\/","url_meta":{"origin":224,"position":3},"title":"How to generate passwords for .htpasswd using PHP","author":"Virendra Chandak","date":"March 2, 2014","format":false,"excerpt":"In my earlier post about .htaccess I had described about authentication using .htaccess and command to generate .htpasswd file. However, when we want to add passwords for many users that method will take too long, since we will have to add passwords for each user one at a time. However,\u2026","rel":"","context":"In &quot;Security&quot;","block_context":{"text":"Security","link":"https:\/\/www.virendrachandak.com\/techtalk\/category\/security\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":545,"url":"https:\/\/www.virendrachandak.com\/techtalk\/404-error-page-best-practices\/","url_meta":{"origin":224,"position":4},"title":"404 Error Page Best Practices","author":"Virendra Chandak","date":"November 20, 2011","format":false,"excerpt":"A 404 error page is the page that the user may reach due to various reasons. Some of the reasons are: The user has entered \/ spelt the URL incorrectly. The page has been moved or deleted. The URL they clicked on was incomplete or cut in an email or\u2026","rel":"","context":"In &quot;Functionality&quot;","block_context":{"text":"Functionality","link":"https:\/\/www.virendrachandak.com\/techtalk\/category\/functionality\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":163,"url":"https:\/\/www.virendrachandak.com\/techtalk\/creating-multiple-virtual-websites-in-wampserver\/","url_meta":{"origin":224,"position":5},"title":"Creating multiple virtual hosts\/websites in Wampserver","author":"Virendra Chandak","date":"June 25, 2011","format":false,"excerpt":"To create multiple websites, it would be helpful to have each website setup on the local computer. With Wampserver (or just Apache) we can easily configure multiple websites. Following are the steps to create multiple websites using Apache's configuration. This uses Apache's \"Named Virtual Hosts\" configuration. I have tested these\u2026","rel":"","context":"In &quot;Server Configuration&quot;","block_context":{"text":"Server Configuration","link":"https:\/\/www.virendrachandak.com\/techtalk\/category\/server-configuration\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.virendrachandak.com\/techtalk\/wp-json\/wp\/v2\/posts\/224","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.virendrachandak.com\/techtalk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.virendrachandak.com\/techtalk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.virendrachandak.com\/techtalk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.virendrachandak.com\/techtalk\/wp-json\/wp\/v2\/comments?post=224"}],"version-history":[{"count":0,"href":"https:\/\/www.virendrachandak.com\/techtalk\/wp-json\/wp\/v2\/posts\/224\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.virendrachandak.com\/techtalk\/wp-json\/wp\/v2\/media?parent=224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.virendrachandak.com\/techtalk\/wp-json\/wp\/v2\/categories?post=224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.virendrachandak.com\/techtalk\/wp-json\/wp\/v2\/tags?post=224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}