What am I doing wrong? Getting a 404 error

Discuss practical ways rearrange URLs using mod_rewrite.

What am I doing wrong? Getting a 404 error

Postby guest » Sun Apr 17, 2005 2:50 pm

Hi, I am new to modrewrite and this is what I am trying to accomplish:

I currently have urls like this:
http://domain/display.php?id=1
http://domain/display.php?id=2
etc.

I want them to be like this if possible:
http://domain/1/
http://domain/2/
etc

I have tried a bunch of ways but this is my most recent non working attempt...... I get a 404 error:

RewriteEngine On
RewriteRule ^([0-9]+)/? display.php?id=$1 [L]

Anyone see what I am doing wrong?
Any help is greatly appreciated.
guest
 

Postby Caterham » Mon Apr 18, 2005 6:30 am

If you're getting a 404 for /1/ , you should ask your provider, if you can use mod_rewrite in .htaccess files. Or are you using the rules in httpd.conf?
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm

Postby Guest » Mon Apr 18, 2005 6:37 am

I used mod_rewrite in my .htaccess file to set a redirect that worked fine so I am pretty sure it is turned on. If it works for a redirect it should work for this, right?

The only thing I can think of is that this is a new site and I am still waiting on my domain to propagate so I am using the IP to view the site at the moment. Do you think that could be causing the issue?
Guest
 

Postby Caterham » Mon Apr 18, 2005 6:45 am

There are two possible reasons: Either the pattern did not match (or are you getti ng the error for display.php?) or in httpd.conf, for your <Directory>-Container pointing to your new? htdocs-folder, AllowOverride is not set (at least) to FileInfo.

the IP could not cause the issue.
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 15 guests

cron