Jump to content

suntracker

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Posts posted by suntracker

  1. After much frustration I now have code to do what I want:

     

    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{QUERY_STRING} !^(.*&)action=submit(&.*)?$ [NC]
    RewriteCond %{QUERY_STRING} !^(.*&)?mod_rewrite=no(&.*)?$ [NC]
    RewriteCond %{QUERY_STRING} ^(.*&)?title(=.+)$ [NC]
    RewriteRule ^mediawiki/index\.php$ /index.php?%1wiki%2 [R=301,L]
    RewriteRule ^mediawiki/index\.php/(.*[^/])/?$ /index.php?wiki=$1 [R=301,L]
    

  2. /httpdocs/index.php

    /httpdocs/.htaccess

    /httpdocs/mediawiki/

     

    The two rules you made for me yesterday work just fine:

    RewriteRule ^mediawiki/index.php/(.+)$ index.php?wiki=$1  [R=301]

    RewriteRule ^mediawiki/index.php/(.+)/$ index.php?wiki=$1  [R=301]

     

    Except it operates on URL's of the form /mediawiki/index.php/Desired_Page instead of /mediawiki/index.php?title=Desired_Page

     

    RewriteRule ^mediawiki/index.php?title=(.+)$ index.php?wiki=$1  [R=301]

    does not work on http://foo.com/mediawiki/index.php?title=Desired_Page

  3. I guess I don't understand why I can't just remove the $ so it takes the rest of the URL along with it...

    RewriteRule ^mediawiki/index.php?title=(.+) index.php?wiki=$1  [R=301,L]

     

    Wouldn't that take everything after php?title= and put it in $1?

     

    so if it was index.php?title=FOO&action=BAR it would result in index.php?wiki=FOO&action=BAR ??

  4. Here is how I need to be able to rewrite things:

     

     

    Change:

    http://foo.com/mediawiki/index.php?title=Main_Page

    To:

    http://foo.com/index.php?wiki=Main_Page

     

    ---

     

    Change:

    http://foo.com/mediawiki/index.php/Main_Page

    To:

    http://foo.com/index.php?wiki=Main_Page

     

    ---

     

    Change:

    http://foo.com/mediawiki/index.php?title=Main_Page&action=edit

    To:

    http://foo.com/index.php?wiki=Main_Page&action=edit

     

     

    I've looked around on documentation on the whole mod rewrite issue and the syntax is so confusing.

    I'll keep reading..

     

  5. Alright, I've been making progress.

     

    One thing I've noticed, though: If you want to edit a page, it forms a different kind of link:

    http://foo.com/mediawiki/index.php?title=Main_Page&action=edit

     

    So instead of the index.php/Main_Page format, I have to deal with ?title=*&action=*

     

    I tried to make another .htaccess rule, but it doesn't work :[

     

    I've tried these:

    RewriteRule ^mediawiki/index.php(.+)$ index.php?wiki=$1  [R=301]

    RewriteRule ^mediawiki/index.php?title=(.+)$ index.php?wiki=$1  [R=301]

     

    I even tried just taking ANY /mediawiki address and rewriting it... would this be the best option?

    RewriteRule ^mediawiki/(.+)$ index.php?wiki=$1  [R=301]

  6. That sounds not fun.

     

    So it *almost* works now.

     

    Strangely, if I try and include a page on a mediawiki installation that's installed on the same subdomain as the website I'm working on, it doesn't work.

    BUT if I use a different mediawiki installation on a different subdomain, it works!

    I have no idea why.

     

    This has nothing to do with the .htaccess stuff but it's still puzzling.

  7. Ah-Ha!

     

    I added RewriteBase / after the RewriteEngine On line:

     

    The working .htaccess file is now:

     

    Options +FollowSymlinks

    RewriteEngine On

    RewriteBase /

    RewriteRule ^mediawiki/index.php/(.+)$ index.php/?wiki=$1  [R=301]

    RewriteRule ^mediawiki/index.php/(.+)/$ index.php/?wiki=$1  [R=301]

     

  8. no dice :[

     

    This isn't very easy!

     

    I'm actually having trouble including the mediawiki page to even render in the <div>... the funny thing is that it works fine under a regular wiki, but not with my modified skin.

  9. Ah, that fixed it. Server doesn't complain anymore.

     

    Now I've run into another issue...

     

    When I click a link in the wiki, like "http://beta2.armyproperty.com/mediawiki/index.php/LINK"

    the .htaccess forms the following:

    "http://beta2.armyproperty.com/var/www/vhosts/armyproperty.com/subdomains/beta2/httpdocs/index.php/?wiki=LINK"

     

    Obviously the /var/www/vhosts/armyproperty.com/subdomains/beta2/httpdocs/" shouldn't be there...

    Other than that, it's neat .htaccess rewrite rules are so powerful.

     

    Thanks for sticking with me in the thread to help.

  10. It's Apache.

     

    I learned that I need to put Options +FollowSymlinks before I try and turn the rewrite engine on, but it still threw the error.

     

    I haven't been using an .htaccess file before now so I removed the two rules:

    RewriteRule ^mediawiki/index.php/(.+)$ index.php/?wiki=$1  [R=301,L]

    RewriteRule ^mediawiki/index.php/(.+))/$ index.php/?wiki=$1  [R=301,L]

     

    And can access the site again.

    Maybe it's the R=301?

     

     

  11. Hi. I don't know if this is possible but I hope it is...

     

    I'm building a website which requires that some pages are editable via a wiki-like system.

    I installed mediawiki, which is located at /httpdocs/mediawiki (the rest of the website resides in /httpdocs/

     

    Now, I can render any single page of the wiki into the central column of the website using a php include, BUT any link within that wiki page naturally tries to take the user to something like:

    http://foo.com/mediawiki/index.php/LINK

     

    Is it possible to 'hijack' that link so that whenever anybody wishes to navigate to other wiki pages, it alters it to something like:

    http://foo.com/index.php/?wiki=LINK (effectively removing the /mediawiki/ component of the address)

     

    I don't really know how to go about this.

    I've heard of people using a wiki and creating a 'normal' looking website out of it, but a majority of the funtionality and content for this site is not really wiki-based so I don't think I can go to that extreme.

     

    Thanks for any assistance!

    -Austin

  12. I always found it fun to come up with user-names.
    One day I wanted a new one and wondered what I could pick... I like space (who doesn't?) so I chose the Sun... I dunno why but the thought of following it as it moved in the sky made me think of the word 'tracker'. Hence Sun Tracker.

    Now here's the weird part: 2 years after I originally came up with it, I was randomly watching TV (I rarely do) -- the history channel, specifically. There was this show on about some failed US Air Force experiment in 1948. A B-29 Bomber carrying a device called the "Sun Tracker" crashed into Lake Meade. (You can read more about it here: http://www.smithsonianmag.com/history-archaeology/digs.html )

    This led me to some internet sleuthing and I learned that a "Sun Tracker" is a nickname for a heliostat -- a device that tracks the sun. Dish arrays out west in the USA use such devices to always aim at the sun to collect as much energy as possible. It's also apparently the name of some company that makes boats or something.
  13. I am very new to PHP and took a look at the FAQ presented here: http://www.phpfreaks.com/forums/index.php/topic,31047.0.html

    The first topic in there (regarding the dynamic URL's) is what I believe to be my problem/issue.

     

    Here are my questions:

     

    1) That thread is pretty old (2004) -- If I have several static elements on a page (like a menu / sidebar / footer / etc) but wish to load content into a center column (all links followed will have PHP load the new page into that div), is using $_GET still the preferred way to do this?

     

    2) If YES to #1, Google Analytics doesn't like these dynamic addresses. Should the above method be used and then do I need to translate those addresses to appear static?

     

    3) If YES to #1, is using a static caseswitch.php file the only way to do this? New pages will be generated all the time... it would be really a pain to have to constantly update that file. Would it be better to somehow query a database?

     

    4) If NO to #1, what is the currently preferred method to switch content on a page?

     

    Thank you for any assistance,

    -Austin

  14. I've spent about 2 or 3 hours tinkering and trying to figure out how to fix this but I've had it and need help.

    I need to put an Adsense ad in a div which hugs the right side of the page. I figured floating it right would do the trick, however once I did that, the min-width of the rest of the website is not respected at all.

     

    Here's the page: http://beta2.armyproperty.com

    Notice that by shrinking the width of the browser, the Ad is allowed to be drawn on top of the rest of the content (Or drops the content down if using IE) (as opposed to halting it's movement to the right edge of the main layout), and the main layout can compress to nothing (if using firefox).

     

    Here's the Index code:

    <body>
    <!------------------------- AD CONTAINER ---------------------->
    <div class="adContainer">
      <?php include ('pageContent/common_googleAds.php'); ?>
    </div>
    <!---------------------- MAIN SCREEN LAYOUT ------------------->
    <div id="screenLayout">        
    	<div id="headerContainer">
    	  <?php include ('pageContent/common_header.php'); ?>
    	</div>
    
    	<div id="sideMenuPanel"> 
    	  <?php include ('pageContent/common_sideMenu.php'); ?>
    	</div>
    
    	<div id="mainPanel">
    	  <?php include ('pageContent/pageContent_home.php'); ?>
    	</div>
    
    	<div id="footerContainer" align="center">
    	  <strong>©2008 | Inventory Management Solutions Inc.</strong>
    	</div>
    </div>
    </body>
    

     

    Here's the CSS:

     

    #screenLayout {
    width: 90%;
    margin: 10px auto;
    min-width: 1000px;
    max-width: 1200px;
    }
    * html .screenLayout {
      height: 100%;
    }
    
    .adContainer {
    width: 120px;
    float: right;
    }
    

     

    Any ideas on how to do this elegantly? I want the Ad to hug the right side, not overlap or cause the main content to drop, and not destroy the min-width stuff.

    Thanks for any help you can provide!

    -Austin

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.