There's htaccess and mod_rewrite but no rewrite

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
parka
Forum Commoner
Posts: 52
Joined: Mon Feb 26, 2007 6:48 am

There's htaccess and mod_rewrite but no rewrite

Post by parka »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


(I'm on Mac OS10.5)

Ok, I ran phpinfo() and it shows that mod_rewrite module is loaded.

Next, I created .htaccess and put in the top directory

[syntax="apache"]RewriteEngine On

RewriteRule ^old\.php$ new.php
There would get a 404 Not Found error when I try to load old.php
The requested URL /~teohyc/htdocs/chilli/old.php was not found on this server.
What gives? I don't think I need to amend httpd.


feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Top directory would be /~teohyc? The regex won't match then.
parka
Forum Commoner
Posts: 52
Joined: Mon Feb 26, 2007 6:48 am

Post by parka »

My directory structure is actually something like http://123.456.7.89/~teohyc/htdocs/chilli

The .htaccess was put in the /chilli directory.
All my pages are in the /chilli directory.

When I moved the .htaccess, together with the new.php, right into the / directory, it didn't work also.
That's puzzling.

(I noticed that this might be a wrong forum to post a Apache question. Please move if necessary)
Post Reply