laPistola Posted July 4, 2011 Share Posted July 4, 2011 Please see this thread for more details http://www.phpfreaks.com/forums/index.php?topic=234739.0;topicseen . I stumbled to it after a Google search. Server: Apache/2 PHP: 5.3.6 PHP is ran as CGI. Im trying to achieve a friendly URL for a blog im writting. ie the url looks like domain.com/blogs/article/1 where as blogs is the .php file After a ForceType not working due to my host using CGI to run php files I found this solution and inserted it into my .htaccess file: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L] which just made a redirection of domain.com/blogs/.php (it entered a / slash between blogs and .php) So after reading the above linked to thread I changed my .htaccess file to: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule (.*)/?$ $1.php [NC,L] Which like the OP in that thread I received an 500 error. This is the log error: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. Now I only really what this on the blogs.php file as the rest of the site is fairly static. Any help would be great thank you. Quote Link to comment https://forums.phpfreaks.com/topic/241102-removing-php-in-url/ Share on other sites More sharing options...
laPistola Posted July 5, 2011 Author Share Posted July 5, 2011 After finding the sticky to an article that explained quiet well how to write rewrites I did this: RewriteEngine On RewriteRule ^blogs/article/([0-9]+)/?$ blogs.php?bid=$1 [NC,L] And it worked great! Quote Link to comment https://forums.phpfreaks.com/topic/241102-removing-php-in-url/#findComment-1238387 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.