htaccess to manually redirect to renamed "Main Page"
<p>Our site has something like this as our <code>.htaccess</code></p><pre><br /><code>RewriteEngine On<br />RewriteRule ^/wiki/Main_Page$ /wiki/Welcome_to_Our_Site [R]<br />RewriteRule ^/?wiki/?$ / [R]<br /><br />RewriteRule ^/?$ %{DOCUMENT_ROOT}/index.php?title=Welcome_to_Our_Site [L,QSA]<br />RewriteRule ^/?wiki(/.+)$ %{DOCUMENT_ROOT}/index.php [L]<br />RewriteRule ^/?w(/.*)?$ %{DOCUMENT_ROOT}/index.php [L]<br /><br />RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f<br />RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d<br />RewriteRule ^/?images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/thumb.php?f=$1&width=$2 [L,QSA,B]<br /><br />RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f<br />RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d<br />RewriteRule ^/?images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B]<br /></code><br /></pre><p>I have also used <code>MediaWiki:Mainpage</code> to point to <code>Welcome_to_Our_Site</code>.</p><p>For the sake of users who may have bookmarked the old page, I would also like <code>Main_Page</code> to manually redirect to <code>Welcome_to_Our_Site</code>--<em>without a redirect notice</em>--but it is not happening.</p><p>I originally moved the <code>Main Page</code> to <code>Welcome_to_Our_Site</code>, creating a redirect within the Mediawiki software, but even when I delete the <code>Main Page</code> or add text into it without a redirect, my <code>htaccess</code> rule does not override Mediawiki's own redirecting as I think it should and redirect <code>Main Page</code> to <code>Welcome_to_Our_Site</code>, changing the URL, but without the Mediawiki "(Redirected from Main Page)" redirect text showing up. What is wrong with the line I expect should do the trick <code>RewriteRule ^/wiki/Main_Page$ /wiki/Welcome_to_Our_Site [R]</code> or the cascading after it?</p><br /><h2>Click here view more answers <a href="http://ift.tt/1QuZSPM">http://ift.tt/1QuZSPM</a></h2>
Nhận xét
Đăng nhận xét