Forum Moderators: phranque
options all
RewriteEngine on
RewriteBase /
RewriteRule rocky /joeboy/index.php
Now I want to add something like the following to the line above.
RewriteRule rocky /joeboy/index.php?$1
Is there a command like the above?$1 that I can add to get the original html file name to tack onto the url before it redirects.
The whole story follows:
When someone types in the url [mysite.com...]
I want the rocky to cause it to forward to /joeboy/index.php but I want to attach the monitor.htm to the query_string somehow so that I can extract it to see what the original url was.
So the forwarding url needs to look something like /joeboy/index.php?monitor.htm
Can I follow the index.php with a?*1 or %1 or $1 or something to grab the original file name and attach it to the redirect url.
When it arrives I want the php file to be able to look at something like the query_string or anything and know what the original requested file was named. That way I could send the visitor to the original file if desired or to someplace else if I choose.
Hope all this makes sense. I know there are some really complicated commands for htaccess and this should be an easy one, but I have no idea what it is and have tried a lot of ideas.
Thanks in advance.
RewriteRule ^rocky/(.*)$ /joeboy/index.php?$1 [L]
Jim
For example every one requesting any of a thousand files in that directory will be screened by php. Say for example the php pulls out the original file name and places it into $go. I then have a command that says if you qualify you get the command include($go); other wise you get the command include("pissoff.htm");
Problem is, the redirect seems to strip all traces of the orginal file name. Isn't there some way to capture it with all the fancy commands in htaccess?
And append it to the /newdir/index.php?orig.htm
I spent I guess a hundred hours or more printing and reading tons of pages from the apachee website and never could figure out how to do this simple task. Acutally nothing is simple if you don't know how to do it.
I cannot thank you enough.
Thank you! Thank you! Thank you! Thank you! Thank you! Thank you!
Now this is a time when you don't mind if a site has a donation jar out.
Also thanks to the other gentleman who offered help, even though it was not exactly what I was looking for, any help or assistance is always appreciated.
P.S.
Hey I am previewing and that is kinda neat how it removes the expletives it don't like but you still get the idea. Where I was talking about the hot thing in the first line.
[edited by: jatar_k at 2:13 am (utc) on Mar. 7, 2006]