{"id":671,"date":"2010-03-20T00:51:02","date_gmt":"2010-03-19T17:51:02","guid":{"rendered":"http:\/\/adityo.blog.binusian.org\/?p=671"},"modified":"2010-03-20T00:53:23","modified_gmt":"2010-03-19T17:53:23","slug":"enable-mod_rewite-on-ubuntu-8-04-server","status":"publish","type":"post","link":"https:\/\/adityo.blog.binusian.org\/?p=671","title":{"rendered":"Enable mod_rewite on ubuntu 8.04 server"},"content":{"rendered":"<p>In order to enable the <em>mod_rewrite<\/em> module in the Ubuntu  server issue the following command:<\/p>\n<p><em># a2enmod rewrite<\/em><\/p>\n<p>The  above Apache2 Enable Module command will add the correct line in the <strong>\/etc\/apache2\/apache2.conf <\/strong>file. The precise command will be added on \/etc\/apache2\/mods-enabled\/rewrite.load<\/p>\n<p>LoadModule rewrite_module \/usr\/lib\/apache2\/modules\/mod_rewrite.so<\/p>\n<p>then restart your apache2<\/p>\n<p>#\/etc\/init.d\/apache2 restart<\/p>\n<p>then checked your apache modules on your phpinfo, create phpinfo.php on your web root directory<\/p>\n<p>&lt;? phpinfo(); ?&gt;<\/p>\n<p>then browse it<\/p>\n<p><a href=\"http:\/\/adityo.blog.binusian.org\/files\/2010\/03\/New-Picture.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-674\" title=\"New Picture\" src=\"http:\/\/adityo.blog.binusian.org\/files\/2010\/03\/New-Picture.png\" alt=\"New Picture\" width=\"545\" height=\"66\" \/><\/a><\/p>\n<p>Simple test:<\/p>\n<p>Nice looking URLs (no querying) with pagination:<br \/>\nSuppose your url is: <em>domain.com\/article.php?name=title&amp;page=5<br \/>\n<\/em>You want to change: <em>domain.com\/articles\/title\/5\/<\/em><br \/>\nThen write in .htaccess file:<br \/>\n<strong>RewriteRule ^articles\/(A-Za-z0-9-]+)\/([0-9]+)\/?$  article.php?name=$1&amp;page=$2 [L]<\/strong><\/p>\n<p>The rule is defined in regular expression. Here <strong>[L]<\/strong> means Last Rule. It\u2019s called RewriteRule Flags.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In order to enable the mod_rewrite module in the Ubuntu server issue the following command: # a2enmod rewrite The above Apache2 Enable Module command will add the correct line in the \/etc\/apache2\/apache2.conf file. The precise command will be added on \/etc\/apache2\/mods-enabled\/rewrite.load LoadModule rewrite_module \/usr\/lib\/apache2\/modules\/mod_rewrite.so then restart your apache2 #\/etc\/init.d\/apache2 restart then checked your apache modules [&hellip;]<\/p>\n","protected":false},"author":386,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[6026],"class_list":["post-671","post","type-post","status-publish","format-standard","hentry","category-ubuntu","tag-enable-mod_rewite-on-ubuntu-8-04-server"],"_links":{"self":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/users\/386"}],"replies":[{"embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=671"}],"version-history":[{"count":2,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/671\/revisions"}],"predecessor-version":[{"id":676,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/671\/revisions\/676"}],"wp:attachment":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}