.htaccess rewriting
- From: "MS" <SpamNoThnx_santa____clause@xxxxxxxxxxx>
- Date: Tue, 26 Apr 2005 12:59:01 +0000 (UTC)
I know this has been brought up in previous posts, but I did think I
understood the basic principals of rewriterule etc until I tried it...
my understanding was/is
RewriteEngine On // Turns on the rewriting option
RewriteBase /test/ // sets the directory for rewriting so rewriting only
happens within the lower directories of /test/
RewriteRule A B // find regex A and replaces it with B
is this correct ?
I am trying to replace part of my url as follows...
http://www.mydomain.co.uk/test/?p=article&id=1
replace "?p=" with "" (nothing)
replace "&id=" with "/"
to create a static looking url
http://www.mydomain.co.uk/test/article/1
my .htaccess file looks like...
RewriteEngine On
RewriteBase /test/
RewriteRule ^(\?p=)$ ^$
this excludes the &id= part as I thought I would deal with the ?p= first
Questions.
Should the .htaccess file be in the root or in /test/ or both?
Are my assumptions correct about the behaviour of the 3 commands?
Why isn't it working?
I have looked at http://httpd.apache.org/docs-2.1/mod/mod_rewrite.html but
it is hard getting those details into my thick head !!
Alex
--
----------------------------------------------------------------------------
http://www.clickonlingerie.com?SIG - Exotic Erotic Lingerie
----------------------------------------------------------------------------
.
- Prev by Date: Re: simple oop question: accessor function
- Next by Date: Re: PHP variables are always empty
- Previous by thread: Roadesend compiler
- Next by thread: get browser details
- Index(es):
Relevant Pages
|