How can I check to see if my server allows mod_rewrite?

Discussions about Apache mod Rewrite, .htaccess, Use, experiences ... URL Rewriting.

Moderator: Moderators

How can I check to see if my server allows mod_rewrite?

Postby rotwyla98 » Fri Feb 16, 2007 10:24 pm

I have tried to install a bunch of mods here that contain mod_rewrite rules and each one had errors.

The links on the page worked (so they showed what they needed to show (e.g.: domain.com/forim/catname.html) but when I clicked on it, it gave me errors such as viewtopic.php could not be found and things of that sort.

Any way to check to see if mod_rewrite can be used on my server?

Thanks
rotwyla98
 
Posts: 6
Joined: Fri Feb 16, 2007 10:20 pm

Advertisement

Postby dcz » Sat Feb 17, 2007 12:51 am

And welcome :D

So first, mod_rewrite is an Apache module allowing us to play with our URLs. So all of this only apply if your run Apache as a server.
On windows server, it is still possible to use isapi_rewrtie with small adaptations.

A very basic test can tell you if mod rewrite is available :

1) create an html page called found.html with whatever you want in it, but some text to be sure it's loaded (not a blank page basically) and put this in an file called ".htaccess" :

Code: Select all
RewriteEngine on
RewriteBase /
RewriteRule ^find\.html$ /found.html [L]


2)
upload both your .htaccess and the found.html files in your domain's root (read this about how to transfer .htaccess files if you encounter problems).

3) Just try to load -www.example.com/find.html (with your real domain of course). If mod_rewrite is available, you should see the content of found.html while browsing find.html (which does not physically exist by the way).

If it does not work, try :

Code: Select all
RewriteEngine on
RewriteBase /
RewriteRule ^find\.html$ found.html [L]


If none work, mod_rewrite is most likely not loaded.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21406
Joined: Fri Apr 28, 2006 9:03 pm

Postby rotwyla98 » Sat Feb 17, 2007 1:19 am

Its works. I guess I must be adding the mds wrong. I'll try it again and be more careful.

Thanks
rotwyla98
 
Posts: 6
Joined: Fri Feb 16, 2007 10:20 pm

Postby rotwyla98 » Sat Feb 17, 2007 2:14 pm

dcz,

I sent you a PM. Check it when you get the chance and tell me what you think.
rotwyla98
 
Posts: 6
Joined: Fri Feb 16, 2007 10:20 pm


Return to Apache mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 3 guests