[Mediawiki-l] converting ugly url to pretty with rewrite

Tels nospam-abuse at bloodgate.com
Sun Apr 23 17:06:19 UTC 2006


Moin,

On Sunday 23 April 2006 18:40, Michelle wrote:
> Sorry to bug everyone again... I want to use mod rewrite to convert
> ugly url's (index.php?title=Main_Page) to nicer ones (index.php/
> Main_page).  The ugly URL is enabled in my LocalSettings.php.
>
> I've created this .htaccess file:
>
> RewriteRule ^index.php?title=(.*)$ index.php/$1 [L]
>
> And put it in my root directory.  But it seems to have no effect (the
> provider says rewriting is enabled).
>
> Does anyone see what I'm doing wrong?

I had the same problem, and after digging around that worked:


	RewriteEngine on
	php_flag register_globals 0
	# /wiki/Foo => /wiki/index.php?title=Foo
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule ^wiki\/(.+)$ /wiki/index.php?title=$1 [L,QSA]

The RewriteEngine on needs to be there, and the rewriting is better than 
the rule you have (which did not work on my server, either).

HTH,

Tels

-- 
 Signed on Sun Apr 23 19:05:24 2006 with key 0x93B84C15.
 Visit my photo gallery at http://bloodgate.com/photos/
 PGP key on http://bloodgate.com/tels.asc or per email.

 ". . . my work, which I've done for a long time, was not pursued in
 order to gain the praise I now enjoy, but chiefly from a craving after
 knowledge, which I notice resides in me more than in most other men. And
 therewithal, whenever I found out anything remarkable, I have thought it
 my duty to put down my discovery on paper, so that all ingenious people
 might be informed thereof." -- Antony van Leeuwenhoek. Letter of June
 12, 1716

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: not available
Url : http://lists.wikimedia.org/pipermail/mediawiki-l/attachments/20060423/99eadaa4/attachment.pgp 


More information about the MediaWiki-l mailing list