Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Mediawiki

Re: Need Help with Short URLs

 

 

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded


knittingand at gmail

Aug 9, 2013, 4:59 PM

Post #1 of 14 (42 views)
Permalink
Re: Need Help with Short URLs

I anaged to get it to redirect to Main-Page by changing LocalSettings to

$wgScriptPath = "/w";
$wgScriptExtension = ".php";
$wgArticlePath = "/wiki";
$wgUsePathInfo = true;

but still can't get the article name to show up.



--
View this message in context: http://wikimedia.7.x6.nabble.com/Need-Help-with-Short-URLs-tp5010861p5010866.html
Sent from the WikiMedia General mailing list archive at Nabble.com.

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


knittingand at gmail

Aug 9, 2013, 5:10 PM

Post #2 of 14 (41 views)
Permalink
Re: Need Help with Short URLs [In reply to]

Forget that. That made everything redirect to the main page. :/



--
View this message in context: http://wikimedia.7.x6.nabble.com/Need-Help-with-Short-URLs-tp5010861p5010868.html
Sent from the WikiMedia General mailing list archive at Nabble.com.

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


knittingand at gmail

Aug 10, 2013, 4:27 PM

Post #3 of 14 (35 views)
Permalink
Re: Need Help with Short URLs [In reply to]

No-one? I've gone through all the help pages I can find a second time and I
still can't get it to work.





--
View this message in context: http://wikimedia.7.x6.nabble.com/Need-Help-with-Short-URLs-tp5010861p5010990.html
Sent from the WikiMedia General mailing list archive at Nabble.com.

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


dave at uesp

Aug 10, 2013, 5:15 PM

Post #4 of 14 (35 views)
Permalink
Re: Need Help with Short URLs [In reply to]

Have you gone through the guides at
http://www.mediawiki.org/wiki/Manual:Short_URL, or more specifically
http://www.mediawiki.org/wiki/Manual:Short_URL/Apache? If you did what
doesn't work or at what point do you have issues?


On 10 August 2013 19:27, Sarah Brdberry <knittingand [at] gmail> wrote:

> No-one? I've gone through all the help pages I can find a second time and I
> still can't get it to work.
>
>
>
>
>
> --
> View this message in context:
> http://wikimedia.7.x6.nabble.com/Need-Help-with-Short-URLs-tp5010861p5010990.html
> Sent from the WikiMedia General mailing list archive at Nabble.com.
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>



--
Dave Humphrey -- dave [at] uesp
Founder/Server Admin of the Unofficial Elder Scrolls Pages -- www.uesp.net
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


knittingand at gmail

Aug 10, 2013, 5:25 PM

Post #5 of 14 (34 views)
Permalink
Re: Need Help with Short URLs [In reply to]

Thanks for the reply. It seems my original post may have only gone to the
web archives and not out to the list.

I have tried every version of the redirect code I can find. Short URLS are
working but redirecting from the long version goes to index.php instead of
the article name

I have recently moved my wiki from
http://www.knitting-and.com/wiki to http://www.knitting-and.com/w and want
the entries to still show at http://www.knitting-and.com/wiki

I've set up the redirects following the info at
http://www.mediawiki.org/wiki/Manual:Short_URL but I've done something wrong
and I can't figure out what

Full URLs such as
http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage)
are redirecting to
http://www.knitting-and.com/wiki/index.php<http://www.knitting-and.com/index.php>
instead of
http://www.knitting-and.com/wiki/Lacy_Gloves_(Vintage)

I have the following in the .htaccess file in my root directory:

RewriteEngine On
RewriteBase /~myusername
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?wiki(/.*)?$ /w/index.php [L]

and this in my LocalSettings.php in the "w" directory

$wgScriptPath = "/w";
$wgScriptExtension = ".php";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;

Any help would be greatly appreciated!

Sarah


On 11 August 2013 10:15, Dave Humphrey <dave [at] uesp> wrote:

> Have you gone through the guides at
> http://www.mediawiki.org/wiki/Manual:Short_URL, or more specifically
> http://www.mediawiki.org/wiki/Manual:Short_URL/Apache? If you did what
> doesn't work or at what point do you have issues?
>
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


dave at uesp

Aug 10, 2013, 5:55 PM

Post #6 of 14 (35 views)
Permalink
Re: Need Help with Short URLs [In reply to]

A few things you can check/try:

1) Make sure your Apache rewrite engine and htaccess use is on and working
(ex: change the rewrite rule to something more obvious/different).
2) The rewrite rules you have are slightly different than the ones
specified in the tutorial:

RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]

The RewriteCond's are optional and shouldn't make a difference but you can
try removing them. Is the RewriteBase line there correct for your setup?
3) If you have access to the Apache root configuration you can try using
Alias instead like I do (I don't believe you can use Alias in a .htaccess
file):
Alias /wiki /home/absolute/path/www/w/index.php
Alias /index.php /home/absolute/path/www/w/index.php #Optional
Obviously substitute your wiki's absolute path on the right side of the
alias.



On 10 August 2013 20:25, Sarah Bradberry <knittingand [at] gmail> wrote:

> Thanks for the reply. It seems my original post may have only gone to the
> web archives and not out to the list.
>
> I have tried every version of the redirect code I can find. Short URLS are
> working but redirecting from the long version goes to index.php instead of
> the article name
>
> I have recently moved my wiki from
> http://www.knitting-and.com/wiki to http://www.knitting-and.com/w and want
> the entries to still show at http://www.knitting-and.com/wiki
>
> I've set up the redirects following the info at
> http://www.mediawiki.org/wiki/Manual:Short_URL but I've done something
> wrong
> and I can't figure out what
>
> Full URLs such as
> http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage)
> are redirecting to
> http://www.knitting-and.com/wiki/index.php<
> http://www.knitting-and.com/index.php>
> instead of
> http://www.knitting-and.com/wiki/Lacy_Gloves_(Vintage)
>
> I have the following in the .htaccess file in my root directory:
>
> RewriteEngine On
> RewriteBase /~myusername
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule ^/?wiki(/.*)?$ /w/index.php [L]
>
> and this in my LocalSettings.php in the "w" directory
>
> $wgScriptPath = "/w";
> $wgScriptExtension = ".php";
> $wgArticlePath = "/wiki/$1";
> $wgUsePathInfo = true;
>
> Any help would be greatly appreciated!
>
> Sarah
>
>
> On 11 August 2013 10:15, Dave Humphrey <dave [at] uesp> wrote:
>
> > Have you gone through the guides at
> > http://www.mediawiki.org/wiki/Manual:Short_URL, or more specifically
> > http://www.mediawiki.org/wiki/Manual:Short_URL/Apache? If you did what
> > doesn't work or at what point do you have issues?
> >
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>



--
Dave Humphrey -- dave [at] uesp
Founder/Server Admin of the Unofficial Elder Scrolls Pages -- www.uesp.net
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


knittingand at gmail

Aug 10, 2013, 6:16 PM

Post #7 of 14 (35 views)
Permalink
Re: Need Help with Short URLs [In reply to]

On 11 August 2013 10:56, Dave Humphrey [via Wikimedia] <
ml-node+s7n5010997h39 [at] n6> wrote:

> A few things you can check/try:
>
> RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
> RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]
>

I just gave it a go but it's returning a 404 error if you try and look at
a wiki page with a long url.

If I use the short URL code from
http://www.mediawiki.org/wiki/Manual:Short_URL it will return
http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage) with
a 404 or
http://www.knitting-and.com/w/index.php?title=Lacy_Gloves_(Vintage)<http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage)>
with the correct page but a long url

I don't have access to the apache root configuration.




--
View this message in context: http://wikimedia.7.x6.nabble.com/Need-Help-with-Short-URLs-tp5010861p5011000.html
Sent from the WikiMedia General mailing list archive at Nabble.com.
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


phoenixoverride at gmail

Aug 10, 2013, 6:44 PM

Post #8 of 14 (35 views)
Permalink
Re: Need Help with Short URLs [In reply to]

both short and long urls are working for me

On Sat, Aug 10, 2013 at 9:16 PM, Sarah Bradberry <knittingand [at] gmail>wrote:

> On 11 August 2013 10:56, Dave Humphrey [via Wikimedia] <
> ml-node+s7n5010997h39 [at] n6> wrote:
>
> > A few things you can check/try:
> >
> > RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
> > RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]
> >
>
> I just gave it a go but it's returning a 404 error if you try and look at
> a wiki page with a long url.
>
> If I use the short URL code from
> http://www.mediawiki.org/wiki/Manual:Short_URL it will return
> http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage)with
> a 404 or
> http://www.knitting-and.com/w/index.php?title=Lacy_Gloves_(Vintage)<
> http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage)>
> with the correct page but a long url
>
> I don't have access to the apache root configuration.
>
>
>
>
> --
> View this message in context:
> http://wikimedia.7.x6.nabble.com/Need-Help-with-Short-URLs-tp5010861p5011000.html
> Sent from the WikiMedia General mailing list archive at Nabble.com.
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


knittingand at gmail

Aug 10, 2013, 7:31 PM

Post #9 of 14 (35 views)
Permalink
Re: Need Help with Short URLs [In reply to]

Long urls aren't redirecting to index.php?


On 11 August 2013 11:44, John <phoenixoverride [at] gmail> wrote:

> both short and long urls are working for me
>
> On Sat, Aug 10, 2013 at 9:16 PM, Sarah Bradberry <knittingand [at] gmail
> >wrote:
>
> > On 11 August 2013 10:56, Dave Humphrey [via Wikimedia] <
> > ml-node+s7n5010997h39 [at] n6> wrote:
> >
> > > A few things you can check/try:
> > >
> > > RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
> > > RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]
> > >
> >
> > I just gave it a go but it's returning a 404 error if you try and look
> at
> > a wiki page with a long url.
> >
> > If I use the short URL code from
> > http://www.mediawiki.org/wiki/Manual:Short_URL it will return
> >
> http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage)with
> > a 404 or
> > http://www.knitting-and.com/w/index.php?title=Lacy_Gloves_(Vintage)<
> > http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage)>
> > with the correct page but a long url
> >
> > I don't have access to the apache root configuration.
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://wikimedia.7.x6.nabble.com/Need-Help-with-Short-URLs-tp5010861p5011000.html
> > Sent from the WikiMedia General mailing list archive at Nabble.com.
> > _______________________________________________
> > MediaWiki-l mailing list
> > MediaWiki-l [at] lists
> > https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
> >
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>



--
Knitting and crafts - online for over 17 years! http://knitting-and.com
Craft videos http://youtube.com/knittingand
Cooking videos http://youtube.com/thevintagekitchen
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


knittingand at gmail

Aug 10, 2013, 7:33 PM

Post #10 of 14 (35 views)
Permalink
Re: Need Help with Short URLs [In reply to]

Sorry, I changed it back to what I originally had because of the high
amount of traffic I have on short urls.

So it was short urls working, long urls redirecting to index.php with the
current setup (.htaccess and LocalSettings that I originally posted).


On 11 August 2013 12:31, Sarah Bradberry <knittingand [at] gmail> wrote:

> Long urls aren't redirecting to index.php?
>
>
> On 11 August 2013 11:44, John <phoenixoverride [at] gmail> wrote:
>
>> both short and long urls are working for me
>>
>> On Sat, Aug 10, 2013 at 9:16 PM, Sarah Bradberry <knittingand [at] gmail
>> >wrote:
>>
>> > On 11 August 2013 10:56, Dave Humphrey [via Wikimedia] <
>> > ml-node+s7n5010997h39 [at] n6> wrote:
>> >
>> > > A few things you can check/try:
>> > >
>> > > RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
>> > > RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]
>> > >
>> >
>> > I just gave it a go but it's returning a 404 error if you try and look
>> at
>> > a wiki page with a long url.
>> >
>> > If I use the short URL code from
>> > http://www.mediawiki.org/wiki/Manual:Short_URL it will return
>> >
>> http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage)with
>> > a 404 or
>> > http://www.knitting-and.com/w/index.php?title=Lacy_Gloves_(Vintage)<
>> > http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage)>
>> > with the correct page but a long url
>> >
>> > I don't have access to the apache root configuration.
>> >
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> >
>> http://wikimedia.7.x6.nabble.com/Need-Help-with-Short-URLs-tp5010861p5011000.html
>> > Sent from the WikiMedia General mailing list archive at Nabble.com.
>> > _______________________________________________
>> > MediaWiki-l mailing list
>> > MediaWiki-l [at] lists
>> > https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>> >
>> _______________________________________________
>> MediaWiki-l mailing list
>> MediaWiki-l [at] lists
>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>
>
>
>
> --
> Knitting and crafts - online for over 17 years! http://knitting-and.com
> Craft videos http://youtube.com/knittingand
> Cooking videos http://youtube.com/thevintagekitchen
>



--
Knitting and crafts - online for over 17 years! http://knitting-and.com
Craft videos http://youtube.com/knittingand
Cooking videos http://youtube.com/thevintagekitchen
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


knittingand at gmail

Aug 10, 2013, 7:40 PM

Post #11 of 14 (35 views)
Permalink
Re: Need Help with Short URLs [In reply to]

I just thought of something that is probably the problem (smacking myself
in the forehead here).

I originally set up the wiki infrastructure at knitting-and.com/wiki
People linked to the long form of URLs there
I set up short urls - the incoming long urls were working & redirecting to
the short versions

I moved the wiki infrastructure to knitting-and.com/w with articles at
knitting-and.com/wiki
Long urls are coming into the OLD wiki long URLs at knitting-and.com/wiki/
So I need to set up the old version of the long urls from
knitting-and.com/wiki/ to redirect as well as the current version.

Does that sound right or completely insane?




On 11 August 2013 12:33, Sarah Bradberry <knittingand [at] gmail> wrote:

> Sorry, I changed it back to what I originally had because of the high
> amount of traffic I have on short urls.
>
> So it was short urls working, long urls redirecting to index.php with the
> current setup (.htaccess and LocalSettings that I originally posted).
>
>
> On 11 August 2013 12:31, Sarah Bradberry <knittingand [at] gmail> wrote:
>
>> Long urls aren't redirecting to index.php?
>>
>>
>> On 11 August 2013 11:44, John <phoenixoverride [at] gmail> wrote:
>>
>>> both short and long urls are working for me
>>>
>>> On Sat, Aug 10, 2013 at 9:16 PM, Sarah Bradberry <knittingand [at] gmail
>>> >wrote:
>>>
>>> > On 11 August 2013 10:56, Dave Humphrey [via Wikimedia] <
>>> > ml-node+s7n5010997h39 [at] n6> wrote:
>>> >
>>> > > A few things you can check/try:
>>> > >
>>> > > RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
>>> > > RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]
>>> > >
>>> >
>>> > I just gave it a go but it's returning a 404 error if you try and
>>> look at
>>> > a wiki page with a long url.
>>> >
>>> > If I use the short URL code from
>>> > http://www.mediawiki.org/wiki/Manual:Short_URL it will return
>>> >
>>> http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage)with
>>> > a 404 or
>>> > http://www.knitting-and.com/w/index.php?title=Lacy_Gloves_(Vintage)<
>>> > http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage)
>>> >
>>> > with the correct page but a long url
>>> >
>>> > I don't have access to the apache root configuration.
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > View this message in context:
>>> >
>>> http://wikimedia.7.x6.nabble.com/Need-Help-with-Short-URLs-tp5010861p5011000.html
>>> > Sent from the WikiMedia General mailing list archive at Nabble.com.
>>> > _______________________________________________
>>> > MediaWiki-l mailing list
>>> > MediaWiki-l [at] lists
>>> > https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>> >
>>> _______________________________________________
>>> MediaWiki-l mailing list
>>> MediaWiki-l [at] lists
>>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>>
>>
>>
>>
>> --
>> Knitting and crafts - online for over 17 years! http://knitting-and.com
>> Craft videos http://youtube.com/knittingand
>> Cooking videos http://youtube.com/thevintagekitchen
>>
>
>
>
> --
> Knitting and crafts - online for over 17 years! http://knitting-and.com
> Craft videos http://youtube.com/knittingand
> Cooking videos http://youtube.com/thevintagekitchen
>



--
Knitting and crafts - online for over 17 years! http://knitting-and.com
Craft videos http://youtube.com/knittingand
Cooking videos http://youtube.com/thevintagekitchen
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


tom at hutch4

Aug 10, 2013, 7:59 PM

Post #12 of 14 (35 views)
Permalink
Re: Need Help with Short URLs [In reply to]

The site is redirecting just fine.

You said:
>>>I have recently moved my wiki from
>>>http://www.knitting-and.com/wiki to http://www.knitting-and.com/w and
want
>>>the entries to still show at http://www.knitting-and.com/wiki

They are and all short URL work fine. I am guessing from your original
statement, you changed directories.

http://www.knitting-and.com/wiki/Main_Page and any short URL I browse
to.

I believe you're thinking wiki/index.php?.... instead of
w/index.php?....

Since you changed your directory from /wiki to /w, the long URLs are
now...

http://www.knitting-and.com/w/index.php?title=Main_Page and it works
just fine. /wiki is a rewritten fake directory now, it doesn't really
exist.

If you call /wiki/index.php?.... whatever, anything after the ? is
truncated and index.php shows up as a 404, uncreated article. This
behavior is correct. Rewrite is parsing and preforming correctly as far
as I can tell. Even &action=edit shows me the source of a page.

Tom


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


knittingand at gmail

Aug 10, 2013, 8:08 PM

Post #13 of 14 (35 views)
Permalink
Re: Need Help with Short URLs [In reply to]

Thanks, that's what I suddenly just realised too (hence the smacking myself
in the forehead) :P

So I'm guessing the best thing to do is either contact the owners of the
sites with bad links and getting them to change them (if the sites are
still updated) is my best option.

Thanks for your help!


On 11 August 2013 13:00, Tom Hutchison [via Wikimedia] <
ml-node+s7n5011010h42 [at] n6> wrote:

> The site is redirecting just fine.
>
> You said:
> >>>I have recently moved my wiki from
> >>>http://www.knitting-and.com/wiki to http://www.knitting-and.com/w and
> want
> >>>the entries to still show at http://www.knitting-and.com/wiki
>
> They are and all short URL work fine. I am guessing from your original
> statement, you changed directories.
>
> http://www.knitting-and.com/wiki/Main_Page and any short URL I browse
> to.
>
> I believe you're thinking wiki/index.php?.... instead of
> w/index.php?....
>
> Since you changed your directory from /wiki to /w, the long URLs are
> now...
>
> http://www.knitting-and.com/w/index.php?title=Main_Page and it works
> just fine. /wiki is a rewritten fake directory now, it doesn't really
> exist.
>
> If you call /wiki/index.php?.... whatever, anything after the ? is
> truncated and index.php shows up as a 404, uncreated article. This
> behavior is correct. Rewrite is parsing and preforming correctly as far
> as I can tell. Even &action=edit shows me the source of a page.
>
> Tom
>
>
> _______________________________________________
> MediaWiki-l mailing list
> [hidden email] <http://user/SendEmail.jtp?type=node&node=5011010&i=0>
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://wikimedia.7.x6.nabble.com/Need-Help-with-Short-URLs-tp5010861p5011010.html
> To unsubscribe from Need Help with Short URLs, click here<http://wikimedia.7.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5010861&code=a25pdHRpbmdhbmRAZ21haWwuY29tfDUwMTA4NjF8LTE1MDMzNzQ2MDg=>
> .
> NAML<http://wikimedia.7.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



--
Knitting and crafts - online for over 17 years! http://knitting-and.com
Craft videos http://youtube.com/knittingand
Cooking videos http://youtube.com/thevintagekitchen




--
View this message in context: http://wikimedia.7.x6.nabble.com/Need-Help-with-Short-URLs-tp5010861p5011011.html
Sent from the WikiMedia General mailing list archive at Nabble.com.
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


daniel at nadir-seen-fire

Aug 10, 2013, 8:28 PM

Post #14 of 14 (35 views)
Permalink
Re: Need Help with Short URLs [In reply to]

Sounds about right. Right now there is no such thing as /wiki/index.php
since you moved to /w/index.php.
So /wiki/index.php is being treated as the page linked to by
[[index.php]]. But the url for that is wrong since the proper key for that
title is [[Index.php]] because by default [[foo]] and [[Foo]] are the same
page. So MW is redirecting to the upper-case version at /wiki/Index.php.
And the query is being discarded because the only thing inside it is the
?title=... (see what happends when you go to
https://en.wikipedia.org/w/index.php?title=wikipedia).
Ideally you'd have never used /wiki/index.php in the first place, but too
it's late for that.

Now the path router I introduced that now handles short urls is fairly
flexible. I haven't tested it but to experiment try adding this to your
LocalSettings.php.

$wgHooks['WebRequestPathInfoRouter'] = function( $router ) {
$router->addStrict( "/wiki/index.php", array( 'title' => false ) );
$router->add( "/wiki/index.php/$1" );
return true;
};

The other, classic way to fix this of course would simply be a rewrite
rule to 301 redirect all /wiki/index.php paths to /w/index.php.

--
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]

On Sat, 10 Aug 2013 19:40:27 -0700, Sarah Bradberry
<knittingand [at] gmail> wrote:

> I just thought of something that is probably the problem (smacking myself
> in the forehead here).
>
> I originally set up the wiki infrastructure at knitting-and.com/wiki
> People linked to the long form of URLs there
> I set up short urls - the incoming long urls were working & redirecting
> to
> the short versions
>
> I moved the wiki infrastructure to knitting-and.com/w with articles at
> knitting-and.com/wiki
> Long urls are coming into the OLD wiki long URLs at
> knitting-and.com/wiki/
> So I need to set up the old version of the long urls from
> knitting-and.com/wiki/ to redirect as well as the current version.
>
> Does that sound right or completely insane?


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.