Need help with writing rule

Topics: User Forum
Nov 13, 2007 at 6:34 PM
I want to write a rule:

http://answerweb.mysite.com/MainPage translates to http://mainsite/Wiki/index.php?title=MainPage

(FYI, I have another web page at http://mainsite )

Appreciate your help. You don't have to write it for me ;-) feel free to give me pointers.
Nov 13, 2007 at 10:02 PM
Edited Nov 13, 2007 at 10:18 PM
I got this to work as

#Redirect all pages that are requested from http://answerweb.mysite.com/XYZ
# to http://answerweb.mysite.com/wiki/index.php?title=XYZ

RewriteCond %{SERVER_NAME} answerweb\.mysite\.com I
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ /wiki/index.php?title=$1 R=301,U,I,L


Here is the part that is not working, Any ideas?

#Redirect all pages that are requested from http://answerweb.mysite.com/
# to http://answerweb.mysite.com/wiki/index.php?title=Main_Page

RewriteCond %{SERVER_NAME} answerweb\.mysite\.com I
RewriteRule ^/$ /wiki/index.php?title=$1 R,U,I,L