Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/241102-removing-php-in-url/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.