.htaccess rewrite to index.php infinite loop -


I am creating a clean URL system using .htaccess and php. The main idea is that it works for index.php to rewrite everything and to split / to split the URL, but when I upload it to a web server, I get an infinite loop error .

My .htaccess file is:

  RewriteCond% {REQUEST_FILENAME} on RewriteEngine -dRewriteCond% {REQUEST_FILENAME} -f RewriteRule !. Index.php [L]  

If I get things correctly - the problem is that it redirects itself to index.php, but it should not be because I have Index.php file that handles everything and revoked code% {REQUEST_FILENAME}! -f should stop writing that.

Can you please help me with this .htaccess - I want to write everything like index.php and rewrite it as portable as it could be, so i I can use the following:

www.mysite.com www.myothersite.com

or even www.mysite.com/new/

< P> I also want to redirect to www.mysite.com/articles/it/2 or even www.mysite.com/articles/ with some index.php like www.mysite.com/articles/2 Are there. It / search / Srctrm

has the .htaccess here code that uses "clean URLs" approach You are trying to get it.

  #form 'index.php? Q = 'x' to rewrite the 'x' form? RewriteBase / RewriteCond% {REQUEST_FILENAME} on RewriteEngine! -f RewriteCond% {REQUEST_FILENAME}! -d RewriteCond% {REQUEST_URI}! = / Favicon.ico RewriteRule ^ (. *) $ Index.php? Q = $ 1 [L, QSA]  

In this case, it connects the clean URL as the "U" Kvikstring parameters. Then

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -