znaji Posted December 19, 2013 Share Posted December 19, 2013 Hi Rewrite rules will not work on cheap hosted godaddy server however rewrite works locally. Can someone le me know whats wrong or the right way please. Working locally but not hosted. RewriteEngine onRewriteBase /RewriteCond %{HTTP_HOST} !^www\.RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] #AddType application/x-httpd-php .php5 .php4 .php .php3 .php2 .phtml#AddHandler x-httpd-php5-3 .phpRewriteRule ^profile/([a-zA-Z0-9_-]+)/comment/([0-9]+) statusview.php?s=$2&user=$1RewriteRule ^profile/([a-zA-Z0-9_-]+)/notifications notifications.php?userid=$1RewriteRule ^profile/([a-zA-Z0-9_-]+) profile.php?id=$1RewriteRule ^create-account create-account.phpRewriteRule ^forgot-password forgot-password.phpRewriteRule ^about about.phpRewriteRule ^privacy privacy.phpRewriteRule ^terms-of-service terms-of-service.phpRewriteRule ^contact contact.phpRewriteRule ^login login.phpRewriteRule ^([a-z_-]+)/([a-z0-9_-]+)/([0-9]+) comment.php?subcat=$3RewriteRule ^category/([a-zA-Z_-]+) category.php?cat=$1RewriteRule ^how-it-works how-it-works.phpRewriteRule ^updates updates.php Link http://www.example.com/profile/john does not work have to use http://www.example.com/profile.php?id=john to test. Quote Link to comment https://forums.phpfreaks.com/topic/284865-rewrite-not-working/ Share on other sites More sharing options...
Solution PravinS Posted December 20, 2013 Solution Share Posted December 20, 2013 check if mod_rewrite is enabled in php.ini Quote Link to comment https://forums.phpfreaks.com/topic/284865-rewrite-not-working/#findComment-1462805 Share on other sites More sharing options...
znaji Posted December 20, 2013 Author Share Posted December 20, 2013 check if mod_rewrite is enabled in php.ini Thank you I was over thinking it. However I found a simple soultion for Godaddy hosting (In my case). Just add the follwoing and it fixed it right away. #Fix Rewrite Options -Multiviews Quote Link to comment https://forums.phpfreaks.com/topic/284865-rewrite-not-working/#findComment-1462806 Share on other sites More sharing options...
Ch0cu3r Posted December 20, 2013 Share Posted December 20, 2013 check if mod_rewrite is enabled in php.ini mod_rewrite is not a PHP extension! It is an Apache module, which you can enable in the httpd.conf Quote Link to comment https://forums.phpfreaks.com/topic/284865-rewrite-not-working/#findComment-1462814 Share on other sites More sharing options...
PravinS Posted December 20, 2013 Share Posted December 20, 2013 mod_rewrite is not a PHP extension! It is an Apache module, which you can enable in the httpd.conf yeah, thanks for correcting Quote Link to comment https://forums.phpfreaks.com/topic/284865-rewrite-not-working/#findComment-1462818 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.