Rewrite Engine (mod_rewrite) not working on subdirectories - Fixed

Started on the old forum in May 2011 · view the original in the archive · old links redirect here

1 reply · 712 views · started 15 years ago · 1 min read

2 participants
Mysterio Lead · 630 posts #1

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

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close