Difference between revisions of "How to check if mod rewrite is enabled on your server"
From Joomla! Documentation
m (removed Category:Needs updating using HotCat) |
(Several markup changes.) |
||
Line 1: | Line 1: | ||
<noinclude><languages /></noinclude> | <noinclude><languages /></noinclude> | ||
<translate><!--T:1--> | <translate><!--T:1--> | ||
− | Many problems with | + | Many problems with search engine optimization arise from the fact that a host has not enabled the Apache setting ''mod_rewrite''. They often tell you they have while they have not. You can verify if this is correct and if this is causing your server to issue HTTP Error 500.</translate> |
<translate><!--T:2--> | <translate><!--T:2--> | ||
− | Here is how to check if mod_rewrite is really enabled | + | Here is how to check if ''mod_rewrite'' is really enabled.</translate> |
<translate><!--T:3--> | <translate><!--T:3--> | ||
− | + | 1. Enable SEO in your Administrator.</translate> | |
<translate><!--T:5--> | <translate><!--T:5--> | ||
− | Site | + | Set {{rarr|Site,Global Configuration,SEO Settings,Search Engine Friendly URLs}} to ''Yes''. Set ''URL Rewriting'' to ''Yes''. (Setting ''Add suffix'' to ''URLs'' is optional).</translate> |
− | |||
<translate><!--T:6--> | <translate><!--T:6--> | ||
− | + | 2. Rename your ''htaccess.txt'' to ''.htaccess''</translate> | |
<translate><!--T:7--> | <translate><!--T:7--> | ||
− | Next place | + | Next place '''only''' the following lines in your ''.htaccess'' file:</translate> |
− | < | + | <syntaxhighlight lang="apache"> |
RewriteEngine On | RewriteEngine On | ||
Options +FollowSymLinks | Options +FollowSymLinks | ||
RewriteRule ^joomla\.html http://www.joomla.org/? [R=303,L] | RewriteRule ^joomla\.html http://www.joomla.org/? [R=303,L] | ||
− | </ | + | </syntaxhighlight> |
− | |||
<translate><!--T:8--> | <translate><!--T:8--> | ||
− | + | 3. Now point your browser to ''https://www.example.com/joomla.html''</translate> | |
<translate><!--T:9--> | <translate><!--T:9--> | ||
− | (Replace www.example.com with your own domain name in the URL above.)</translate> | + | (Replace ''www.example.com'' with your own domain name in the URL above.)</translate> |
<translate><!--T:10--> | <translate><!--T:10--> | ||
− | If it redirects you to joomla.org then mod_rewrite is working.</translate> | + | If it redirects you to ''joomla.org'' then ''mod_rewrite'' is working.</translate> |
<translate><!--T:11--> | <translate><!--T:11--> | ||
− | If it gives you an error | + | If it gives you an error, ''mod_rewrite'' is not working.</translate> |
<translate><!--T:12--> | <translate><!--T:12--> | ||
− | Note | + | '''Note''' if your site is located in a folder such as ''/test'', you need to insert the code in the root ''.htaccess'' file as follows:</translate> |
− | < | + | <syntaxhighlight lang="apache"> |
RewriteEngine On | RewriteEngine On | ||
Options +FollowSymLinks | Options +FollowSymLinks | ||
RewriteRule ^test/joomla\.html http://www.joomla.org/? [R=303,L] | RewriteRule ^test/joomla\.html http://www.joomla.org/? [R=303,L] | ||
− | </ | + | </syntaxhighlight> |
<noinclude> | <noinclude> |
Latest revision as of 15:01, 3 October 2022
Many problems with search engine optimization arise from the fact that a host has not enabled the Apache setting mod_rewrite. They often tell you they have while they have not. You can verify if this is correct and if this is causing your server to issue HTTP Error 500.
Here is how to check if mod_rewrite is really enabled.
1. Enable SEO in your Administrator.
Set Site → Global Configuration → SEO Settings → Search Engine Friendly URLs to Yes. Set URL Rewriting to Yes. (Setting Add suffix to URLs is optional).
2. Rename your htaccess.txt to .htaccess
Next place only the following lines in your .htaccess file:
RewriteEngine On
Options +FollowSymLinks
RewriteRule ^joomla\.html http://www.joomla.org/? [R=303,L]
3. Now point your browser to https://www.example.com/joomla.html
(Replace www.example.com with your own domain name in the URL above.)
If it redirects you to joomla.org then mod_rewrite is working. If it gives you an error, mod_rewrite is not working.
Note if your site is located in a folder such as /test, you need to insert the code in the root .htaccess file as follows:
RewriteEngine On
Options +FollowSymLinks
RewriteRule ^test/joomla\.html http://www.joomla.org/? [R=303,L]