Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite help

         

mealybar

1:18 am on Oct 7, 2005 (gmt 0)

10+ Year Member



I did a bit with mod rewrite a while back with your help on here :) cheers, just having a few problems second time round :s

I want [url.com...] (and other query string from blah/-> onwards) to go to [url.com...] ('/b-gen/' or other args). My Blah message forum can handle these args, just I cant get my mod rewrite to work. Also idealy I'd like [url.com...] to replace [url.com...] eventually, but anything that works is a starter :)

I've got this;


Options All Indexes
IndexOptions FancyIndexing

RewriteEngine On

RewriteBase /forum

RewriteRule ^(.*) /forum/blah/Blah.pl?$1

I know some extra folder bits are needed in either the first part of rewrite rule or the base (havent had experience with using base), but I've tried a few combinations with no luck. Also have tried putting this htacess in each different folder; root/forum/blah - no luck.

Thanks in advance :)

jdMorgan

1:38 am on Oct 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Get rid of RewriteBase unless you're using aliased pathnames.

.htaccess in Web root directory:


RewriteEngine On
# Prevent rewrite looping
RewriteCond %{REQUEST_URI} !^/forum/blah/Blah\.pl
# Rewrite to Blah.pl with requested filename in query string
RewriteRule ^forum/blah(.*)$ /forum/blah/Blah.pl?$1 [L]

For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].

Jim

mealybar

2:08 am on Oct 7, 2005 (gmt 0)

10+ Year Member



and that gets put in the root folder? Ifso is it ok to be added just after my other htaccess stuff in there?

cheers :)

jd01

4:51 pm on Oct 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, and it should be fine, as long as you don't have any other rules that conflict with the ones you are adding. (You will not need RewriteEngine on again.)

Justin