Jump to content

suntracker

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

suntracker's Achievements

Newbie

Newbie (1/5)

0

Reputation

  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. I had already tried that. There must be something else wrong here... something we're not seeing.
  3. /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
  4. This is my most recent concoction and still no dice: RewriteRule ^mediawiki/index.php?title=(.+)&action=(.+)$ index.php?wiki=$1&action=$2 [R=301]
  5. Nah, I just miswrote it in my post. It is title in my file.
  6. 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 ??
  7. This is a good resource: http://httpd.apache.org/docs/1.3/misc/rewriteguide.html
  8. 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..
  9. 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]
  10. Ah, nevermind. When i'm doing the php include it needs the full address (include 'http://foo.com/mediawiki/index.php?title='.$_GET['wiki'] phew!
  11. 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.
  12. 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]
  13. 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.
  14. 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.
  15. Ah, I've narrowed it down. It doesn't like the second rule you gave me.
×
×
  • 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.