software development


I was just curious if anyone else has ever tried doing mod_rewrite on their website. I can’t get it to work, and frankly right now I’m upset with DH’s support. It’s taking a long time for replies. I’ve set up a webpage via a tut about mod_rewrite and it is supposed to say “This is bob’s page”, but it doesn’t (which it

Anyone have any ideas? Thanks,


You probably have a mistake in your rewrite rules. I use mod_rewrite extensively on my site and it works fine.

Learn to love the mod_rewrite documentation. It may take a little time and patience but you’ll get it eventually.

You may find it helpful to post your rules here. Many eyes and all that.

If you want useful replies, ask smart questions.


Yeah, kchrist is probably right about that. I also make extensive use of mod_rewrite, and everything works just fine; however, I’m hopeless at writing it myself. I always need other people to help me with it. I find the documentation completely bewildering!

Simon Jessey
Keystone Websites | si-blog


Thanks for helping out. DH support is really annoying me right now.

Right now, I’ve got my .htaaccess file set to:
I’ve got the .htaaccess file in …/

RewriteEngine on
RewriteRule ^alice.html$ bob.html

I’ve also got an alice.html and bob.html file in the same directory. From what I read of the tutorial, it should display “This is bob’s page” which is what bob.html is.

I’ve also read that mod_rewrite should show up in loaded module in php_info (, but I can’t find mod_rewrite within it.

Any help would be greatly appreciated. I’m really trying to redo my website within the next couple days to monitor bandwidth for pictures.



It won’t appear because you have your version of PHP set to run in CGI mode. Compare your phpinfo file to my own. You will see the mod_rewrite module in the apache section.

Simon Jessey
Keystone Websites | si-blog


Changed my PHP to not run as CGI, however, didn’t change much. It now displays mod_rewrite under phpinfo, but it didn’t change anything for my mod_rewrite.

Can you give me any example mod_rewrite that I can test?



Here’s a basic redirect, using mod_rewrite, that will make your server transparently redirect from old.html to the new.html page.:

RewriteEngine on RewriteRule ^old\.html$ new.htmlHere’s the same rule, but modified to force a new HTTP request:

RewriteEngine on RewriteRule ^old\.html$ new.html [R]---------------
Simon Jessey
Keystone Websites | si-blog


Nope…didn’t change a thing.

That should still say “Bob” (which is new.html), but it still doesn’t :(.

Have any ideas?



It’s .htaccess - you’ve got too many a’s. Check the filename on the server.

:cool: Perl / MySQL / HTML+CSS


Perfect!! :smiley:

That wasn’t so hard, thanks for actually helping.

The only problem I have now, is that when it looks for “new.html”, it tries to go to:

instead of just

Any idea why?

Thanks again very much!,


The only problem I have now, is that when it looks for “new.html”, it tries to go to:

You’re using the filesystem path (eg, /home/username/domain/etc) instead of the URI path. The path in your rewrite rules should be relative to the web site’s document root. In your case this is /home/pyius/ Leave this part out.

If you want useful replies, ask smart questions.


Thanks again.

I got everything up and working now ^_^.

You all are much more helpful than DH support :P. Now I can start revamping my site…I’ve only got about 2 days left.

Thanks again,