{"id":648,"date":"2022-09-12T18:31:53","date_gmt":"2022-09-12T18:31:53","guid":{"rendered":"https:\/\/glossary.dream.press\/glossary\/%group%\/mod_rewrite\/"},"modified":"2025-05-07T23:38:30","modified_gmt":"2025-05-07T23:38:30","slug":"mod_rewrite","status":"publish","type":"glossary","link":"https:\/\/glossary.dream.press\/glossary\/hosting\/mod_rewrite\/","title":{"rendered":"mod_rewrite"},"content":{"rendered":"\n<p>mod_rewrite is a fantastic module to use for <a href=\"https:\/\/www.dreamhost.com\/glossary\/domains\/url\/\">URL<\/a> rewriting. However, it\u2019s more suited to <a href=\"https:\/\/www.dreamhost.com\/glossary\/hosting\/apache\/\">Apache<\/a> experts and intermediate users than beginners.<\/p>\n\n\n\n<p>For some simpler, less complex URL manipulation tasks, the mod_alias module is probably a better solution. It allows for control and manipulation of URLs as requests arrive at the server rather than on the fly.<\/p>\n\n\n\n<p>mod_rewrite uses the Perl Compatible Regular Expression vocabulary for all its expressions and references.<\/p>\n\n\n\n<p>As with other modules, mod_rewrite has several directives to perform various actions. Two of the most common directives are RewriteBase, which sets the base URL for the rewrite, and RewriteCond, which defines conditions for the rewrite.<\/p>\n\n\n\n<p>One of the fundamental features of mod_rewrite is its detailed logging of actions. You can use the LogLevel directive to set the level of detail provided in the logs. The debug level means that nothing is logged at all, while levels trace1 to trace8 incrementally bring up the number of logged actions.<\/p>\n","protected":false},"featured_media":0,"parent":0,"menu_order":0,"template":"","meta":{"_acf_changed":false,"_yoast_wpseo_metadesc":"In the context of Apache servers, mod_rewrite is a module that rewrites requested URLs through a rule-based rewriting engine. This module is an excellent way to manipulate URLs using an unlimited amount of rules and rule conditions."},"group":[17],"class_list":["post-648","glossary","type-glossary","status-publish","hentry","group-hosting"],"acf":{"cta":"Hosting","term_definition":"In the context of Apache servers, mod_rewrite is a module that rewrites requested URLs through a rule-based rewriting engine. This module is an excellent way to manipulate URLs using an unlimited amount of rules and rule conditions.","h2_more":"More About mod_rewrite","title_tag":"What is mod_rewrite?"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What is mod_rewrite? - DreamHost Glossary<\/title>\n<meta name=\"description\" content=\"In the context of Apache servers, mod_rewrite is a module that rewrites requested URLs through a rule-based rewriting engine. This module is an excellent way to manipulate URLs using an unlimited amount of rules and rule conditions.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/glossary.dream.press\/glossary\/hosting\/mod_rewrite\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is mod_rewrite? - DreamHost Glossary\" \/>\n<meta property=\"og:description\" content=\"In the context of Apache servers, mod_rewrite is a module that rewrites requested URLs through a rule-based rewriting engine. This module is an excellent way to manipulate URLs using an unlimited amount of rules and rule conditions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dreamhost.com\/glossary\/hosting\/mod_rewrite\/\" \/>\n<meta property=\"og:site_name\" content=\"DreamHost Glossary\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-07T23:38:30+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is mod_rewrite? - DreamHost Glossary","description":"In the context of Apache servers, mod_rewrite is a module that rewrites requested URLs through a rule-based rewriting engine. This module is an excellent way to manipulate URLs using an unlimited amount of rules and rule conditions.","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:\/\/glossary.dream.press\/glossary\/hosting\/mod_rewrite\/","og_locale":"en_US","og_type":"article","og_title":"What is mod_rewrite? - DreamHost Glossary","og_description":"In the context of Apache servers, mod_rewrite is a module that rewrites requested URLs through a rule-based rewriting engine. This module is an excellent way to manipulate URLs using an unlimited amount of rules and rule conditions.","og_url":"https:\/\/www.dreamhost.com\/glossary\/hosting\/mod_rewrite\/","og_site_name":"DreamHost Glossary","article_modified_time":"2025-05-07T23:38:30+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/glossary.dream.press\/glossary\/hosting\/mod_rewrite\/","url":"https:\/\/glossary.dream.press\/glossary\/hosting\/mod_rewrite\/","name":"What is mod_rewrite? - DreamHost Glossary","isPartOf":{"@id":"https:\/\/glossary.dream.press\/glossary\/#website"},"datePublished":"2022-09-12T18:31:53+00:00","dateModified":"2025-05-07T23:38:30+00:00","description":"In the context of Apache servers, mod_rewrite is a module that rewrites requested URLs through a rule-based rewriting engine. This module is an excellent way to manipulate URLs using an unlimited amount of rules and rule conditions.","breadcrumb":{"@id":"https:\/\/glossary.dream.press\/glossary\/hosting\/mod_rewrite\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/glossary.dream.press\/glossary\/hosting\/mod_rewrite\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/glossary.dream.press\/glossary\/hosting\/mod_rewrite\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dreamhost.com\/glossary\/"},{"@type":"ListItem","position":2,"name":"Terms","item":"https:\/\/www.dreamhost.com\/glossary\/%group%\/"},{"@type":"ListItem","position":3,"name":"mod_rewrite"}]},{"@type":"WebSite","@id":"https:\/\/glossary.dream.press\/glossary\/#website","url":"https:\/\/glossary.dream.press\/glossary\/","name":"DreamHost Glossary","description":"","publisher":{"@id":"https:\/\/glossary.dream.press\/glossary\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/glossary.dream.press\/glossary\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/glossary.dream.press\/glossary\/#organization","name":"DreamHost","url":"https:\/\/glossary.dream.press\/glossary\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/glossary.dream.press\/glossary\/#\/schema\/logo\/image\/","url":"https:\/\/glossary.dream.press\/glossary\/wp-content\/uploads\/2022\/10\/dreamhost-glossary-social.jpg","contentUrl":"https:\/\/glossary.dream.press\/glossary\/wp-content\/uploads\/2022\/10\/dreamhost-glossary-social.jpg","width":2400,"height":1256,"caption":"DreamHost"},"image":{"@id":"https:\/\/glossary.dream.press\/glossary\/#\/schema\/logo\/image\/"}}]}},"lang":"en","translations":{"en":648,"es":1396,"fr":7978,"nl":8026,"it":8810,"pt":10214,"pl":10229,"de":10264,"ru":10490,"uk":10533},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/glossary.dream.press\/glossary\/wp-json\/wp\/v2\/glossary\/648","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/glossary.dream.press\/glossary\/wp-json\/wp\/v2\/glossary"}],"about":[{"href":"https:\/\/glossary.dream.press\/glossary\/wp-json\/wp\/v2\/types\/glossary"}],"wp:attachment":[{"href":"https:\/\/glossary.dream.press\/glossary\/wp-json\/wp\/v2\/media?parent=648"}],"wp:term":[{"taxonomy":"group","embeddable":true,"href":"https:\/\/glossary.dream.press\/glossary\/wp-json\/wp\/v2\/group?post=648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}