0

Hi My web server is Apache.I have created a sample application in my local system. It's working fine with the clean url. But when i uploaded to my Web server( Apache) it's not working. Is there is any settings in Apache? If yes what are the steps? How can I check is mod_rewrite is enable in my Apache server? is it any way to know "mod_rewrite is on " through any PHP coding?

Thanks in advance

Testadmin
  • 2,880
  • 9
  • 49
  • 71

3 Answers3

5

Is there any way to know "mod_rewrite is on " through any PHP coding?

Yes, create a php page with <?php phpinfo(); ?>. This lists your server configuration. Under the apache2handler section in "Loaded Modules" you should see mod_rewrite if it is installed.

If it isn't listed there you will either need to ask your host or if you have access, see the apache modules-enabled folder (eg in /etc/apache2 on a standard installation) to see if there is a mod_rewrite listed.

Hamish
  • 22,860
  • 8
  • 53
  • 67
  • did you leave out phpinfo(); ?? –  Jan 17 '11 at 03:56
  • heh, thanks - not sure what happened there.. maybe it picked up the braces and stripped the tag. – Hamish Jan 17 '11 at 04:31
  • I have a php info page see http://kluzusa.com/php-info.ph. But from here I can't see mod_rewrite. Which indicates it's not enabled. Is it? Also my web site is live site. SO I want to make mod_rewrite only in a folder named url. If activate mod_rewrite by hosting is there any problem in my existing pages? – Testadmin Jan 17 '11 at 04:31
0

Most likely *mod_rewrite* is enabled. If it is not, you will probably need to contact your hosting company to activate it OR override the servers default with RewriteEngine On in your .htacces. Are you getting a 500, Internal Server Error when you try to run the script?

And if it was not compiled (or they can't provide it) with php, then maybe its time to find a new host?

Good luck!

OldWest
  • 2,355
  • 7
  • 41
  • 61
0

If you are using Apache on Ubuntu or DEBIAN write this code in Terminal:

sudo a2enmod rewrite

and restarting apache

sudo invoke-rc.d apache2 restart
Zhasulan Berdibekov
  • 1,077
  • 3
  • 19
  • 39