Hi all, I'm trying, without seccess, to rewrite url for my wiki. I've installed the script in the root of my domain, create the .htaccess file and set this line of code $wgArticlePath = "$wgScript/$1". Can someone help me? Thanks,
Giovanni Putignano
On 05/07/06, Giovanni Putignano gputignano@tiscali.it wrote:
Hi all, I'm trying, without seccess, to rewrite url for my wiki. I've installed the script in the root of my domain, create the .htaccess file and set this line of code $wgArticlePath = "$wgScript/$1".
You will need to provide us with the rewrite rules in use.
Rob Church
On 05/07/06, Giovanni Putignano gputignano@tiscali.it wrote:
You will need to provide us with the rewrite rules in use.
I would like rewrite index.php?title=Main_Page to index.php/Main_Page.
He means what are the contents of your .htaccess file?
He means what are the contents of your .htaccess file?
I have this code:
# close the php security hole... # not actually needed but probably a good idea anyway # php_flag register_globals off
# first, enable the processing - Unless your ISP has it enabled # already. That might cause weird errors. RewriteEngine on
# uncomment this rule if you want Apache to redirect from www.mysite.com/ to # www.mysite.com/wiki/Main_Page # RewriteRule ^/$ /wiki/Main_Page [R]
# do the rewrite RewriteRule ^wiki/?(.*)$ /w/index.php?title=$1 [L,QSA]
Giovanni
On 05/07/06, Giovanni Putignano gputignano@tiscali.it wrote:
He means what are the contents of your .htaccess file?
I have this code:
# do the rewrite RewriteRule ^wiki/?(.*)$ /w/index.php?title=$1 [L,QSA]
Um, is your wiki index.php in the subdirectory called /w/, as in
? If not, that would explain why the above rule would fail to work. Also you said that you wanted the article path to be the same as the script path, but the above doesn't do that, it changes the article path from
http://www.mysite.com/w/index.php?title=Article
to
http://www.mysite.com/wiki/Article
So I suggest you try changing that line to the correct conditions for your site.
RewriteRule ^wiki/?(.*)$ /w/index.php?title=$1 [L,QSA]
So I suggest you try changing that line to the correct conditions for your site.
So to change http://www.mysite.com/index.php?title=Article to http://www.mysite.com/index.php/title=Article or better http://www.mysite.com/Article what I have to write in .htaccess? Excuse me but I don't know how to use rewrite.
Many thanks,
Giovanni
On 05/07/06, Giovanni Putignano gputignano@tiscali.it wrote:
RewriteRule ^wiki/?(.*)$ /w/index.php?title=$1 [L,QSA]
So I suggest you try changing that line to the correct conditions for your site.
So to change http://www.mysite.com/index.php?title=Article to http://www.mysite.com/index.php/title=Article or better http://www.mysite.com/Article what I have to write in .htaccess? Excuse me but I don't know how to use rewrite.
The thing called RewriteRule just changes the left side URL into the right side URL. I don't know exactly how to do what you want to do, but your question is not a MediaWiki question, so if you are really stuck I'd suggest finding a tutorial about RewriteRule on the internet and reading it. You might need to find out about regular expressions as well.
On 7/5/06, Ben Bullock benkasminbullock@gmail.com wrote:
On 05/07/06, Giovanni Putignano gputignano@tiscali.it wrote:
RewriteRule ^wiki/?(.*)$ /w/index.php?title=$1 [L,QSA]
Personally, I've come to enjoy using Aliases instead of Rewrites. Besides being much simpler than rewrites, aliases seem to work much better with special characters than rewrites do. Just need to make sure mod_alias is enabled, but it should be by default, IIRC, since Apache uses quite a few aliases of its own.
My install as the MediaWiki software in /www/w. I access it via a URL of http://myhost/wiki/.
In httpd.conf: Alias /wiki/ /www/w/index.php/ Alias /wiki /www/w/index.php/
In LocalSettings.php: $wgScriptPath = "/w"; $wgArticlePath = "/wiki/$1";
Dan
Personally, I've come to enjoy using Aliases instead of Rewrites. Besides being much simpler than rewrites, aliases seem to work much better with special characters than rewrites do. Just need to make sure mod_alias is enabled, but it should be by default, IIRC, since Apache uses quite a few aliases of its own.
My install as the MediaWiki software in /www/w. I access it via a URL of http://myhost/wiki/.
In httpd.conf: Alias /wiki/ /www/w/index.php/ Alias /wiki /www/w/index.php/
In LocalSettings.php: $wgScriptPath = "/w"; $wgArticlePath = "/wiki/$1";
Dan
Thanks Dan, I can't modify httpd.conf. Regards,
Giovanni
The thing called RewriteRule just changes the left side URL into the right side URL. I don't know exactly how to do what you want to do, but your question is not a MediaWiki question, so if you are really stuck I'd suggest finding a tutorial about RewriteRule on the internet and reading it. You might need to find out about regular expressions as well.
many thanks.
mediawiki-l@lists.wikimedia.org