Mod-Rewrite: Confused with my rewrite rule

Hello all,

I am having a small problem with a rewrite processing the sessions and cookie includes on a template using a current rewrite rule to shorten the url…

current

/.htaccess

RewriteEngine on
Options +FollowSymlinks
RewriteBase /
# TopicIndex #
RewriteRule  ^fs\\.dex/?$ <b>http://www.domain.com.nz</b>/cgi-bin/datacgi/database.cgi?file=Forum&report=TopicIndex [L]

this makes the fs.index/ redirect to the full path which I dont want to do, I actually want it too stay as domain.com.nz/fs.dex/, and what seems to happen I take away the domain name above in bold for a rewrite and the template that is processed doesnt display the cookie/session details of a member. So only part of the website is actual visiable. but if you use the real url everything is back to normal. So I have tried both ways without a result. Sort of put’s me back to sqaure one. Nil

I was reading a lot of threads and nothing I could find would answer this problem…

The only way the template will display properly is if the rule is used above with the bolded domain, but their must be a way to keep the re-writen url in the browser bar and display the tempate as it was intended to without the rewrite. there must be.

Any help is greatful…

Hi,
If I were you I’d attempt to use:

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^fs\.dex/?$ /cgi-bin/datacgi/database.cgi?file=Forum&report=TopicIndex [L]

or

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^fs\.dex/?$ /cgi-bin/datacgi/database.cgi?file=Forum&report=TopicIndex [PT,L]

let me know if they will work.

:slight_smile:

Yes it does work & I thought that it would work that way to, well thats what I thought, HOWEVER…it still doesnt process the user data that runs the whole site and some. if I dont have the whole url in the re-write it wont process the whole webpage…

I’m lost with this one…

hmmm,
I don’t have experience with cookies and sessions but another attempt is this:


RewriteEngine on
Options +FollowSymlinks
RewriteRule ^fs\\.dex/?$ http://www.example.com/cgi-bin/datacgi/database.cgi?file=Forum&report=TopicIndex [P,L]

In pratice it could be possible that the database.cgi will work with an URI as /cgi-bin/etc and not as fs.dex.

mod_proxy should be enabled too.

The advantage of the proxy approach is that even if you requested example.com/fs.dex apache will see a brand new request as example.com/cgi-bin/et_cetera

:slight_smile:

I tried the suggested [P,L], got a 404

I removed the whole url aswell, got a 404

I emailed the webhost to see if mod-proxy is enabled, I have to wait usally they get back to me quite fast.

Nah they said mod_proxy is not enabled, they wont enable it just for me, thats understandable.

Any ideas… Their must be a way to display the links that are relied on cookie information, can rewrite condition % work in anyway.