deansaddigh Posted May 14, 2010 Share Posted May 14, 2010 ive put this RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php in my .h2access file and upload it to htdocs, but it doesnt seem to do anything. meaning i can go to this http://www.languageschoolsuk.com/course_enquiry.php but not http://www.languageschoolsuk.com/course_enquiry Am i doing something wrong Quote Link to comment https://forums.phpfreaks.com/topic/201756-how-do-i-get-my-htaccess-working/ Share on other sites More sharing options...
cags Posted May 15, 2010 Share Posted May 15, 2010 It would have helped if you'd defined "doesn't seem to do anything". What do you get on screen a 500 error? A 404 error? My guess is the later of the two, I'd suggest appending the [R=302] flag to the end of the RewriteRule to see if a.) it's actually rewriting at all and if it is b.) where it's rewriting to. My best guess is you need a forward slash before the $1. Quote Link to comment https://forums.phpfreaks.com/topic/201756-how-do-i-get-my-htaccess-working/#findComment-1058656 Share on other sites More sharing options...
pquery Posted October 25, 2010 Share Posted October 25, 2010 I had the same issue for a while on a new server where I was testing out some new things with mod_rewrite that was running apache2... this is how I solved it go into your /etc/apache2 directory then go into your sites-enabled directory and into the site where you're trying to get the site to have the Rewrite Engine working vi into that file (because hopefully you're doing this at a shell level and not trying to do this from some ISP's control panel editor) it might be named default if you haven't changed any settings an look in the Virtual host settings # AllowOverride None AllowOverride FileInfo Options You need to set the AllowOverride option from none to FileInfo and options (see my example above where I commented out the none) restart your server (/etc/init.d/apache2 restart on debian/ubuntu OR service apache2 [httpd] restart on redhat) and your mod_rewrite changes should take place. Quote Link to comment https://forums.phpfreaks.com/topic/201756-how-do-i-get-my-htaccess-working/#findComment-1126281 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.