Forum Moderators: phranque

Message Too Old, No Replies

Rewrite w/ long query string and scriptalias

         

immasavagebeast

8:30 pm on Oct 3, 2011 (gmt 0)

10+ Year Member



I have an issue with creating my rewrite for this cgi script query string. I'm using mod_alias/scriptalias to point incoming users to run a script. If a user browses to: [//qa3eprpt02.enernoc.lab...] it runs a script an produces an ugly URL: [qa3eprpt02.enernoc.lab...] Basically, I want to strip out the entire URI and query string so users only see a pretty URL: [qa3eprpt02.enernoc.lab...] Below is some of my configuration.

#File called cognos.conf - contains mod_alias directives
ScriptAlias /ibmcognos/cgi-bin /opt/ibm/cognos/c10_64/cgi-bin/
Alias /ibmcognos /opt/ibm/cognos/c10_64/webcontent

<Directory "/opt/ibm/cognos/c10_64/webcontent">
Options Indexes MultiViews
AllowOverride All
</Directory>

#http.conf - section that has the mod_rewrite which I know is awful #and wrong but I need to reconfigure

RewriteEngine On
RewriteCond $1 !ldirector.html
RewriteCond $1 !crossdomain.xml
RewriteCond $1 !ibmcognos
# Comment out line below and replace HOSTNAME with DNS host entry
# for a given environment,ie. qa1report
RewriteRule ^(.*)$ [qa3eprpt02.enernoc.lab...] [R,L]


Any help will be greatly appreciated. Thank you

lucy24

9:28 pm on Oct 3, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



it runs a script an produces an ugly URL

Especially when you forget the part about replacing all real domain names with example.com so we can see what you actually typed.

(I just drifted over to the Forum Charter [webmasterworld.com] because, ahem, I can't remember if I ever got around to reading it. Yes, it does say the "example.com" thing explicitly-- buried way down in the middle of the page. It kinda reads as if all the Code-etc. Forums have basically the same Charter.)

:: uneasily wondering whom to ask about fixing dead links in the Charter* since jdMorgan is tied up in Real Life ::


* Most crucially
http://httpd.apache.org/docs/2.2/rewrite/rewrite_guide.html
which doesn't even redirect, it's just gone. I always start at
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html

immasavagebeast

11:39 am on Oct 4, 2011 (gmt 0)

10+ Year Member



Thanks for the scolding. One, these are all internal URLs not accessible from outside my company. Two, I've been through the docs you sent me. If I was looking links to apache docs then I would have googled it.

lucy24

9:10 pm on Oct 4, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



these are all internal URLs not accessible from outside my company

Anything that does not use "example.com" will automatically turn into a clickable link, so the "pretty URL" and the "ugly URL" look exactly the same. This makes it a little hard to figure out the question.

Sit tight. Someone else will now come along and play Good Cop.

g1smd

1:28 am on Oct 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Since I see that I typed the words "Use example.com to stop URL auto-linking in this forum" more than 20 times last month, I no longer answer questions where that has not been done.