Hello. We all know that the .mqn does not exist. But I want to make my friends believe it does.
What I want here is to change the .html extension to display .mqn in the omnibox. When a user enters, I want index.html to be displayed as index.mqn.
I have the following code in my .htaccess file:
RewriteEngine on
RewriteRule ^(.*)\.html$ $1.mqn
With this code, when someone enters index.mqn, they can see index.html with the .mqn address displayed in the omnibox.
But the thing I want is, also, when someone enters index.html, that index.mqn be displayed in the bar.
Is there any way to achieve this?
You need to redirect user there, add [R] flag to your rule.
RewriteEngine on
RewriteRule ^(.*)\.html$ $1.mqn [R]
RewriteEngine on
RewriteRule ^(.*)\.html$ $1.mqn
With this code, when someone enters index.mqn, they can see index.html with the .mqn address displayed in the omnibox.
That code above does not do what you say it does. That internal rewrites to .mqn
and will display the .html
file in the omnibox. Which will probably give you a 404.
What it seems like you want is the opposite. You want to display the .mqn
files in the omnibox. You should be able to use these rules in your .htaccess file. This should redirect any one who enters a .html file in the omnibox as well as make it appear that .mqn is a real
file.
RewriteEngine On
RewriteCond %{THE_REQUEST} [A-Z]{3,}\ /(.+)\.html [NC]
RewriteRule ^ %1.mqn? [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.mqn$ $1.html [L]