It would be nice if users could enter urls as mydomain.com/articles/3
etc which I believe is achievable with apache mod rewrite. I therefore
added an .htaccess file containing:
RewriteEngine on
RewriteRule ^articles/([^/\.]+)/?$ content.php?artid=$1 [L]
When this didn't work I googled the problem to find the suggestion
that with godaddy it was necessary to add an additional command, ie:
Options -MultiViews
RewriteEngine on
RewriteRule ^articles/([^/\.]+)/?$ content.php?artid=$1 [L]
However, this still returns a "page cannot be found error".
Any suggestions?
Are you sure this .htaccess is accessed?
Just to test its use add a line holding the single word 'bogus' :
a crashing site is proof of usage !
HansH
This works fine for me, given that the URL is
http://mydomain.com/articles/3 or http://mydomain.com/articles/3/ and
there's a content.php script.
Try to have a look at Apache's error log (you may need to enable it in
Godaddy's control panel).
Also, is this your full .htaccess file?
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com
--
[L,R]
You're rewriting a URL to a URL, not to a filename, so you need to re-inject
it by redirection.
Scratch my prior answer (although it may still apply). I see an error with
your rule. Try:
RewriteRule ^/articles/([^/\.]+)/?$ content.php?artid=$1 [L]
You need a leading slash on the URI supplied by the user.
HansH