I use Mediawiki on my site’s subdomain (viki). I changed my url structure.
Old url structure: http://viki.gameofthronestr.com/index.php/Lannister_Hanesi
New url structure: http://viki.gameofthronestr.com/Lannister_Hanesi
I just deleted “/index.php/” from url.
I want to redirect old urls to news on .htaccess. (I use Apache) How i redirect old URL to new?
I tried that but doesnt work:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^viki/(.*)$ /index.php?title=$1 [PT,L,QSA]
RewriteRule ^viki/*$ /index.php [L,QSA]
RewriteRule ^viki$ /index.php [L,QSA]
RewriteRule ^index.php/(.*)$ /$1 [R=301,L]
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I do not believe that the MediaWiki one-click image has the Apache rewrite module enabled by default so there are a couple changes that are needed to have apache use a redirect setup configured in an .htaccess file.
1.) Enable the module with the command
a2enmod rewrite
2.) In your virtualhost configuration file in /etc/apache2/sites-enabled find the “AllowOverride” setting for your main directory and change “AllowOverride None” to “AllowOverride All”, this allows configuration variables in your .htaccess file to override your virutalhost defaults.
3.) Restart apache for the changes to take effect with the command:
service apache2 restart
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.