Results 1 to 5 of 5

Thread: mediawiki apache2 problems

  1. #1
    Join Date
    Nov 2006
    Beans
    169

    mediawiki apache2 problems

    Hello,

    I installed mediawiki manually and it is working, this is the virtual host

    Code:
    <VirtualHost *:80>
         ServerAdmin webmaster@mysite.com
         ServerName mysite.com
         ServerAlias www.mysite.com
         Alias /wiki /srv/www/media/w
         DocumentRoot /srv/www/mysite.com/public_html/
         ErrorLog /var/log/apache2/mysite.com.error.log
         CustomLog /var/log/apache2/mysite.com.access.log combined
    </VirtualHost>
    Now I want to enable the short url to remove the index.php and I need to add some rewrites. These are the rewrites taken from here http://www.mediawiki.org/wiki/Manual..._rewrite_rules

    Code:
    ## http://www.mediawiki.org/wiki/Manual:Short_URL/Apache
     
    # Enable the rewrite engine
    RewriteEngine On 
    # Short url for wiki pages
    RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L] 
    # Redirect / to Main Page
    RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]
    How should I add these? In a directory?

    Thank you.

  2. #2
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    13,050
    Distro
    Kubuntu Development Release

    Re: mediawiki apache2 problems

    No, just add them to the definition of the <VirtualHost> that you have now. Add them below the CustomLog directive. Make sure to restart Apache after you do so with "sudo service apache2 restart".
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Nov 2006
    Beans
    169

    Re: mediawiki apache2 problems

    It does not work. Maybe because it is an alias? In /srv/www/mysite.com/public_html/ I have a wordpress.

    Any clues? Will I have to stick to the ugly index.php?

  4. #4
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    13,050
    Distro
    Kubuntu Development Release

    Re: mediawiki apache2 problems

    If the only index file is index.php, you can just end the URL at "/" and Apache will use index.php in the DocumentRoot. If you want to get rid of all references to index.php, you'll have to play around with that rewrite rule.

    Frankly I don't think it's ugly at all. I've written quite a few sites where index.php is included in the URL when I need to pass parameters with a GET.

    In WordPress, you can control how a posting's URL appears in the composition window. I use the /YYYY/MM/DD/title-of-the-posting/ style myself. Just edit the "permalink" at the top of the composition window. To set the default, go to Settings > Permalink in the Dashboard.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  5. #5
    Join Date
    Nov 2006
    Beans
    169

    Re: mediawiki apache2 problems

    Thank you, but I would like to remove it from mediawiki.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •