web hosting line
1.866.605.2484

Web hosting

Go Back   Web Hosting Forum - Web hosting discussion at SiteGround.com > Popular Software > Other Software and Applications

Reply
 
Thread Tools Display Modes
  #1  
Old 10-22-2006, 05:53 PM
paradox paradox is offline
Junior Member
 
Join Date: Oct 2006
Posts: 6
Default MediaWiki: Short URLs possible?

Hi,

In addition to my previous question (refreshLinks), I was wondering if short URLs are possible here? I've tried to implement them as per http://www.mediawiki.org/wiki/Manual:Short_url and http://meta.wikimedia.org/wiki/Using_a_very_short_URL but to no avail. Any suggestions?

Thanks.
Reply With Quote
  #2  
Old 10-27-2006, 04:46 AM
Bill Bill is offline
Senior Member
 
Join Date: Sep 2005
Posts: 181
Default

Hello,

If you want to use the short URLs, I advise you to proceed as shown in the example below:

For example, install the wiki in /main, and have the following set in LocalSettings.php:

$wgArticlePath = "/wiki/$1";

Then, add the following in the main .htaccess file

RewriteEngine on
RewriteRule ^wiki/(.*)$ /main/index.php?title=$1 [L,QSA]

Please try that and make sure you have no other .htaccess files in the directory above the wiki one.
__________________
Regards,

The SiteGround Support Team
Web Hosting
Reply With Quote
  #3  
Old 11-19-2006, 08:33 PM
trailville trailville is offline
Junior Member
 
Join Date: Nov 2006
Posts: 3
Default Has anyone gotten this to work on siteground

I've tried this along with numerous variations I've fount on other websites and am unable to get it to work.

The .htaccess stuff seems to work because it will allow accessing the site with a short URL (before changing LocalSettings.php).

However, once I change the $wgArticlePath variable to point to the clean format, I receive errors which seem to relate to problems with the $wgScriptPath variable which I did not change (it still points to the original physical directory). Basically I get a php error that points to a line in the code in LocalSettings.php with is the first instance where the variable $wgScriptPath is used.
Reply With Quote
  #4  
Old 11-20-2006, 06:43 PM
trailville trailville is offline
Junior Member
 
Join Date: Nov 2006
Posts: 3
Default This works

I got mine working thanks to posts on the mediawiki user forum at
http://www.mwusers.com/forums/showthread.php?t=950

I thought I would include the changes here in case anyone else wants to do the same thing.

My wiki is installed in /public_html/wiki and the clean url for my main page now comes up as http://www.trailville.com/wiki/Main_Page

added the following to .htaccess file located in /public_html
__________________________________________________ _
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^wiki/(.+)$ /wiki/index.php?title=$1 [L,QSA]
__________________________________________________ ____


changed the following in LocalSettings.php located in /public_html/wiki
__________________________________________________ _________
$wgScriptPath = "/wiki";
$wgScript = "$wgScriptPath/index.php";
$wgRedirectScript = "$wgScriptPath/redirect.php";

## For more information on customizing the URLs please see:
## http://meta.wikimedia.org/wiki/Elimi...p_from_the_url
## If using PHP as a CGI module, the ?title= style usually must be used.
## $wgArticlePath = "$wgScript?title=$1";
$wgArticlePath = "$wgScriptPath/$1";
__________________________________________________ ___________
Reply With Quote
  #5  
Old 10-05-2007, 01:25 AM
Shadow_Guyver Shadow_Guyver is offline
Junior Member
 
Join Date: Oct 2007
Posts: 6
Default

I've recently been attempting to have the Short URLs available for my wiki, but I've tried installing all the codes mentioned in this particular thread and the help info from the mediawiki.org tutorial and I still get that 404 error. The site I'm working on is eWikiMall.com and it's been REALLY frustrating. I have tried inputting the following code:

added the following to .htaccess file located in /public_html
__________________________________________________ _
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^wiki/(.+)$ /wiki/index.php?title=$1 [L,QSA]
__________________________________________________ ____


changed the following in LocalSettings.php located in /public_html/wiki
__________________________________________________ _________
$wgScriptPath = "/wiki";
$wgScript = "$wgScriptPath/index.php";
$wgRedirectScript = "$wgScriptPath/redirect.php";

## For more information on customizing the URLs please see:
## http://meta.wikimedia.org/wiki/Elimi...p_from_the_url
## If using PHP as a CGI module, the ?title= style usually must be used.
## $wgArticlePath = "$wgScript?title=$1";
$wgArticlePath = "$wgScriptPath/$1";
__________________________________________________ ___________

my wiki files are stored in the public_html/wiki directory. do I need to replace the above script in the LocalSettings.php or merely add it? The problem is that I don't see the inclusion of this line ($wgScriptExtension = ".php"; ) in the above script. The only place I can see to replace it is here:
__________________________________________________ ____________
## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
$wgScriptPath = "/Wiki"; <=Right Here?????
$wgScriptExtension = ".php"; <=Right Here?????

## For more information on customizing the URLs please see:
## http://www.mediawiki.org/wiki/Manual:Short_URL

$wgEnableEmail = true;
$wgEnableUserEmail = true;
__________________________________________________ _____________

If someone could help me, It would be greatly appreciated

Last edited by Shadow_Guyver; 10-05-2007 at 01:33 AM. Reason: More details included
Reply With Quote
  #6  
Old 10-05-2007, 07:37 AM
Dan Dan is offline
Banned
 
Join Date: Oct 2006
Posts: 262
Default

It will be easier to set the ShortURLs if create a subdomain wiki.your_domain.com.

If you have your application set on subdomain you may check the following URL for more infomration how to set it with ShortURL:

http://www.mediawiki.org/wiki/Manual:Short_URL

I have checked the method and it is working fine.

Note that you should also contact your web hosting as it seems that the domain eWikiMall.com is not hosted with SiteGound and ask them if the mod_rewrite engine is enabled.
Reply With Quote
  #7  
Old 10-05-2007, 11:02 AM
Shadow_Guyver Shadow_Guyver is offline
Junior Member
 
Join Date: Oct 2007
Posts: 6
Default

So there is no other way around this but to create a subdomain? I didn't even want to show the /wiki folder let alone create another subdomain. If I transfer over my domain hosting from my original hosting company, would that make a difference?
Reply With Quote
  #8  
Old 10-05-2007, 06:27 PM
trailville trailville is offline
Junior Member
 
Join Date: Nov 2006
Posts: 3
Default

The specific code required to get this to work tends to vary somewhat depending on how your host has their servers set up. I was equally aggravated when I was trying to get mine to work since code listed on some sites as working would not work with mine. The solution I provided above is working on my Siteground hosted site with the wiki located in /public_html/wiki , but may very well not work if you are not hosted with Siteground. In fact, it may not even work with another siteground site if siteground doesn't have all their servers set up the same.
I don't know where your site is hosted, but it can be much less aggravating if you host with a host that has a focus on mediawiki (or at least a lot of customers that use mediawiki).

As to your question about adding or replacing the script in your localsettings.php file, you should always search the file for each variable and change it if it already exists. If it doesn't exist, you can add it. The individual variables you need to change (each line in the script) may not necessarily be grouped together in the file, so search for them individually.
Reply With Quote
  #9  
Old 10-06-2007, 01:55 PM
Shadow_Guyver Shadow_Guyver is offline
Junior Member
 
Join Date: Oct 2007
Posts: 6
Default

Well, My site is hosted with SiteGround, however, my domain is registered with a different company (1and1.com). This is pretty frustrating because I really do want to clean up the URL. I was wondering if it was possible for me to request help from the Siteground admin to actually fix this problem. If it is a matter of cost, I would pay to remedy the situation.
Reply With Quote
  #10  
Old 10-08-2007, 07:37 AM
George Y. George Y. is offline
SiteGround Team Member
 
Join Date: Jun 2007
Posts: 95
Default

Hi,

Please note that there is no difference which is your registrar -- as long as your domain name is pointed to our server and your account is properly accessible via your domain there is not problem to set the wiki short URLs.

You can post a ticket under script installation category and our support team will be glad to set it for you.
Reply With Quote
  #11  
Old 10-10-2007, 01:10 AM
Shadow_Guyver Shadow_Guyver is offline
Junior Member
 
Join Date: Oct 2007
Posts: 6
Default

It looks like finally it's working for my site. My friend was able to help me with editing the file. Apparently, he mentioned that the page directories (like "/wiki") are case sensitive? I guess I had the directory labelled "/Wiki" but I kept typing in all in lower case. Thanks everyone for your help!
Reply With Quote
  #12  
Old 10-10-2007, 08:14 PM
Collin1000's Avatar
Collin1000 Collin1000 is offline
Senior Member
 
Join Date: Dec 2006
Posts: 729
Default

The Apache webserver is case sensitieve, indeed. This is a common mistake and I myself forgot it last night when coding a mod for IPB. Oopsie! :P
__________________
-Collin.

I am NOT Siteground staff.
~~~~~~~~~~~
http://www.Collin1000.com
I tweet! @Collin1000
~~~~~~~~~~~
Reply With Quote
  #13  
Old 04-22-2009, 05:05 PM
BradLee's Avatar
BradLee BradLee is offline
Junior Member
 
Join Date: Apr 2009
Posts: 14
Unhappy

I have tried doing this with my website for 3 days now, tried every combination/variation of code posted, and I am still having no luck.

Can someone PLEASE help me out with this?

Firstly I am trying to do this on a subdomain of my website.
The address is http://private.smileypedia.org
The folder that this corresponds with is /public_html/private/
So there is no "wiki' or "w" folder involved.

There are two .htaccess files available, and I have tried posting the rewrite conditions into both.

The first is located in /public_html/ which I am assuming is NOT the one I want correct?
The second is located in /public_html/private/ which I assuming is the CORRECT one? (and is the directory where my wiki is installed)

Next:
I have modified the LocalSettings.php file located in /public_html/private/ (which is the same directory where the .htaccess file is stored).

I am pretty sure that this is the right LocalSettings.php file, because this is where I have also made some other changes that have successfully affected my wiki.

So:
The pages seem to be redirected successfully, as hovering over the links shows the short URLs, but whenever I click on one of them I get a 404 error.
Reply With Quote
  #14  
Old 04-22-2009, 05:15 PM
BradLee's Avatar
BradLee BradLee is offline
Junior Member
 
Join Date: Apr 2009
Posts: 14
Default

No way, I got it working...

The problem was in the RewriteRule ^wiki/(.*)$ /index.php?title=$1 [L,QSA] line.

Of course there is no wiki directory in my case, so it needed to be rewritten as:
RewriteRule ^(.*)$ /index.php?title=$1 [L,QSA]

DOH.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 06:34 PM.

Copyright © SiteGround.com Inc