# [web] Trouble with Apache 1.3 PHP mod_rewrite

This topic is 4449 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello! I used mod_rewrite to get "Pretty URLs" for my website. I got it working then, but I haven't really grasped its innards and I'm having trouble now. First, here's my .htaccess:
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^([a-z/]+)$content.php?module=$1
RewriteRule ^([a-z/]+),([0-9a-zA-Z_\-]+)$content.php?module=$1&id=$2 Its really simple, if there are [a-z/] after the domain name, put the relative path as a module ($_GET) to content.php. You will have noticed that if the path contains -, ~ etc characters it won'y rewrite the URL. I have been using mydomain.com/some-thing for storing files for a long time. Recently I created a mydomain.com/~name subdirectory for my mother so that she can have her own website. The thing is, trying to access PHP files such as mydomain.com/~name/page.php gives a "500 Internal Server Error". I'm guessing mod_rewrite is messing things up. Note: HTML pages such as mydomain.com/~name/page.html don't give an error, it's only files ending with .php. But this means I can't run PHP scripts from that directory :(. Sorry for the long post, I would be really grateful for any help! [smile]

##### Share on other sites
Hmmm, renaming mydomain.com/~name/page.php to mydomain.com/some-name/page.php makes it work! It wasn't mod_rewrite's fault after all! :)

I guess there's some mystery with the tilde that doesn't elt PHP scripts run, or something.

##### Share on other sites
We can only possibly help you if you post:

a) The entire Apache master config
b) The .htaccess file (as above)
c) Relevant lines from the Apache error log.

If you do not have access to all of these things because you're on shared hosting, good luck trying to do anything at all useful. You'll need it.

Mark

##### Share on other sites
Quote:
 a) The entire Apache master config

Not needed. Most are pretty alike.

1. 1
2. 2
3. 3
Rutin
18
4. 4
JoeJ
14
5. 5

• 14
• 10
• 23
• 9
• 36
• ### Forum Statistics

• Total Topics
632634
• Total Posts
3007551
• ### Who's Online (See full list)

There are no registered users currently online

×