|
Posted by Disco Octopus on 12/03/05 15:05
Disco Octopus wrote:
> Disco Octopus wrote:
>
>> Hi,
>>
>> I have a site that uses php query string quite a bit.
>>
>> EG. my pages URLs look like this....
>>
>> example.com/event.php?eve=78
>>
>> I would like to make this a little nicer for the URL and for search
>> engines, etc, and be able to have some kind of forwarding or redirecting to
>> take this....
>>
>> example.com/event/swimming_in_the_pool
>> ...or...
>> example.com/swimming_in_the_pool_event
>> .. and point to...
>> example.com/event.php?eve=78
>>
>> Does anyone know how I would do this in my .htaccess file or http.conf
>> file.
>>
>> Thanks
>
> I have got a little way with some searching on the web.
> This is what I have come up with....
>
> RewriteEngine On
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule ^events/(.*).html /event.php?eventcode=$1 [L]
>
> I would expect that this url....
>
> example.com/events/swimming_in_the_pool.html
> ...would end up executing this page...
> example.com/event?eventcode=swimming_in_the_pool
> ... however, I am getting a return code of 404 - Not found.
>
> Any ideas?
>
> Thanks
OK. I got it sorted....
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/events/(.*).html$ /event.php?code=$1
Now I face another problem (In which I will also post to
alt.www.webmaster)...
On my dev machine (Windows XP) I run Apache, and I put this above code in
my httpd.conf file. This works nicley. However, my host does not allow
access to the httpd.conf file, and therefore I would expect that this same
code can go in my .htaccess file on the server.
Wel, It just doesnt work. Any ideas?
Thanks
--
a beef jerky site http://www.choicebeefjerky.com.au
not a beef jerky site http://mycoolwheels.com/vote.cmks
nobody ever dreams of working for the man
Navigation:
[Reply to this message]
|