Actions

Difference between revisions of "How to check if mod rewrite is enabled on your server"

From Joomla! Documentation

(Using the "Redirect" directive cannot prove whether mod_rewrite is installed. Redirect is a part of mod_alias not mod_rewrite.)
Line 1: Line 1:
Many problems with SEO arise from the fact that a host has not enabled mod_rewrite (Apache setting) on the servers. They often tell they have (while they don't have) and you can verify if this is correct or not and if this is causing you Error 500 etc.
+
Many problems with SEO arise from the fact that a host has not enabled mod_rewrite (Apache setting) on the servers. They often tell you they have (while they have not). You can verify if this is correct or not and if this is causing your server to issue HTTP Error 500.
 
+
Here is how to check if mod-rewrite is realy enabled!
+
  
 +
Here is how to check if mod-rewrite is really enabled!
  
 
'''1. Enable SEO in your administrator:'''
 
'''1. Enable SEO in your administrator:'''
Line 16: Line 15:
  
 
<source lang="apache">
 
<source lang="apache">
 +
RewriteEngine On
 
Options +FollowSymLinks
 
Options +FollowSymLinks
Redirect /joomla.html http://www.joomla.org
+
RewriteRule ^joomla\.html http://www.joomla.org/? [R=301,L]
 
</source>
 
</source>
  
Line 25: Line 25:
 
(Replace www.example.com with your own domain name in the URL above.)
 
(Replace www.example.com with your own domain name in the URL above.)
  
If it redirects you to joomla.org - mod_rewrite is working.
+
If it redirects you to joomla.org then mod_rewrite is working.
If it gives you an error - mod_rewrite is not working.
+
If it gives you an error then mod_rewrite is not working.
  
Note: if your site is located in subdomain example "test" you need to insert in .htaccess as:
+
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:
  
 
<source lang="apache">
 
<source lang="apache">
 +
RewriteEngine On
 
Options +FollowSymLinks
 
Options +FollowSymLinks
Redirect /test/joomla.html http://www.joomla.org
+
RewriteRule ^test/joomla\.html http://www.joomla.org/? [R=301,L]
 
</source>
 
</source>
  

Revision as of 08:24, 24 April 2011

Many problems with SEO arise from the fact that a host has not enabled mod_rewrite (Apache setting) on the servers. They often tell you they have (while they have not). You can verify if this is correct or not 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:

In Joomla 1.0: Site -> Global Configuration -> SEO: Search Engine Friendly URLs to Yes.

In Joomla 1.5: Site -> Global Configuration -> Site: Search Engine Friendly URLs to Yes, Use Apache mod_rewrite 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:

RewriteEngine On
Options +FollowSymLinks
RewriteRule ^joomla\.html http://www.joomla.org/? [R=301,L]


3. Now point your browser to: http://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 then 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=301,L]