Forum Moderators: phranque

Message Too Old, No Replies

mod_rewrite newbie question :-)

Any further comments on this...

         

woldie

9:45 am on Mar 1, 2004 (gmt 0)

10+ Year Member



Hi all,

Yes I have been scouring the forums on this one, but I've had a crack at it, so if any help on this one will be more than appreciated.

I've got this site

[mydomain.com...]

and I would like this to show the following URL:

[mydomain.com...]

I've had a crack at this and here's my attempted effort on this:

RewriteEngine On
RewriteLog /usr/local/apache/logs/rewrite_log
RewriteLogLevel 0
RewriteCond %{REQUEST_URI} ^/test/index.php$ [NC]
RewriteCond %{QUERY_STRING} sid=([0-9]+) [NC]
RewriteRule ^/TEST/index.php /test/%1.html [L,R]

Is it necessary to use RewriteLog command?

Many Thanks

:-)

operafan

10:58 am on Mar 1, 2004 (gmt 0)

10+ Year Member



I think your question is similar to this
[webmasterworld.com...]

woldie

3:23 pm on Mar 1, 2004 (gmt 0)

10+ Year Member



Thanks for that, however what I've done is placed the code into an .htaccess file placed into the 'test' directory, and also placed the file in the root directory.

Then I refresh the website and nothing seems to be working.

I've checked to see mod_rewrite is installed, and it is, I've restarted the web server, and still doesn't work.

Any ideas?

Many Thanks

jdMorgan

5:26 pm on Mar 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



woldie,

Be careful of the restrictions on mod_rewrite directive context -- For example, RewriteLog directives won't work in .htaccess. The valid contexts are described below each directive in the documentation.

In addition to reading the thread at the link that operafan provided, you might also want to try the simple test described here [webmasterworld.com] in message #2.

Jim