Rewrite Engine (mod_rewrite) not working on subdirectories - Fixed

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Rewrite Engine (mod_rewrite) not working on subdirectories - Fixed

    I was mad at 000webhost because I thought my code is not gonna work. But it was my fault.

    I was working in the "beta" subdirectory and here is the code which was giving me error:

    RewriteEngine on
    RewriteRule ^program-([^/\.]+)?$ index.php?page=program&day=$1 [L]

    So how to fix this? Before all code, we need to define the rewrite base, like this:

    RewriteBase /beta (beta in my case).

    ... here goas all other rules ...
    mysterio.al - programming is a functional art

    #2
    didnt you know this before?

    you could also use RewriteRule beta/index.php?page=program....

    Comment

    Working...
    X