Before me is a private host from an ISP who does not want to share secrets.

There is a .htaccess file with the following content:

<FilesMatch "\.(inc)$"> Order allow,deny Deny from all </FilesMatch> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !^/demo/ RewriteRule .* "index.php/?_p=$0" [L] Options -Indexes 

And the index.php file is as follows:

 print_r(explode('/',$_GET['_p'])); 

It seems that everything works perfectly, the CNC meets all the requirements of the task.

BUT for some reason on request /manual/ issues Array(0=>404.shtml) ?

The provider persistently hints that I am bald and sends to .htaccess dock

Tell me my mistakes. Another point: For some reason, internor is issued when there is no RewriteCond %{REQUEST_FILENAME} !-f and RewriteCond %{REQUEST_FILENAME} !-d lines in htaccess.

  • Is there a manual folder in the project? - knes
  • And the root of RewriteBase /? - Ozim
  • Hmmm, I always use $1 o_O - Sh4dow
  • Manual folder no. The root is the root of the site. - org
  • one
    By the way, one of those supporters was advised to write this: RewriteEngine Off :))))))))) I read this: If you have an apache installed on your system, there’s mod_rewriting guide, lives right here. do check out the URL for the juicy syntax bits. That's where I got it, too. How to overcome it in htaccess? - org

3 answers 3

Manual folder usually comes in the Apache assembly. Is she mixed in here?

  • I think yes, it is necessary to clean it in the config file specifically, which the hoster did not do!) - org

Separately register

  RewriteRule /manual "index.php/?_p=manual" [L] 

About the manual did not know. Thank.

  • The idea is good, but does not work. I tried it first) And in different variations ... - org

Hehe ... The hoster is clearly in the config

 AliasMatch ^/manual ... 

somewhere in there. That is, all requests with a path starting with / manual are sent — I don’t know where to go, it looks like a piece of the standard config that sends such requests to the Apache documentation.

The problem is that you cannot replace alias at the .htaccess file level, only at the server or virtual-host settings level. If the hoster does not give you access to the settings of the Apache other than in .htacess, then you will have to agree with him. Alas.

  • I agree, it’s a pity you can’t give two correct answers!) You are a plus, and the author is higher ... - org