tag:blogger.com,1999:blog-865923359735383241.post7617925121509074198..comments2023-10-29T07:27:09.012-06:00Comments on Ccna final exam - java, php, javascript, ios, cshap all in one: easyphp .htaccess rulesUnknownnoreply@blogger.comBlogger1125tag:blogger.com,1999:blog-865923359735383241.post-56737308225285083552012-06-01T22:26:35.954-06:002012-06-01T22:26:35.954-06:00Here's what you need to do:
RewriteEngine On
...Here's what you need to do:<br /><br />RewriteEngine On<br />RewriteBase /<br />RewriteRule ^([a-z0-9_\-]+)/?$ index.php?main=$1 [NC,L] <br />RewriteRule ^([a-z0-9_\-]+)/([a-z0-9_\-]+)/?$ index.php?main=$1&sub=$2 [NC,L]<br /><br /><br />This will allow you to have pages like:<br /><br />http://www.domain.com/mainpage/ or<br />http://www.domain.com/mainpage or<br />http://www.domain.com/mainpage/subpage/ or<br />http://www.domain.com/mainpage/subpage<br /><br /><br />/? Means the slash is optional<br /><br />[NC] This makes the test case-insensitive - differences between 'A-Z' and 'a-z' are ignored, both in the expanded TestString and the CondPattern. This flag is effective only for comparisons between TestString and CondPattern. It has no effect on filesystem and subrequest checks.<br /><br />[L] The [L] flag causes mod_rewrite to stop processing the rule set. In most contexts, this means that if the rule matches, no further rules will be processed.<br /><br />All the information about flags and rules: http://httpd.apache.org/docs/current/mod/mod_rewrite.htmlUserhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.com