Skip to main content
Included reference to current server config
Source Link
MrWhite
  • 43.1k
  • 4
  • 50
  • 90
Options +Indexes +Includes +FollowSymLinks +MultiViews

It looks likeWhy are you may have a conflict withexplicitly enabling MultiViewsMultiViews in your server config? This is likely the cause of your problem. Try removing +MultiViews from your server config (above), and/or disable MultiViews at the top of your .htaccess:

 Options -Indexes -MultiViews

MutliViews is disabled on a default Apache install, however, some (shared) hosts do seem to enable it. So, disabling it in .htaccess as a matter of course is probably recommended.

(But also, why are you enabling Includes - is this really necessary? Since you are using PHP, this is unlikely.)

The effect of MultiViews is noticeable because you have effectively removed the file extension to create your user-friendly URLs.

With MultiViews enabled (part of mod_negotiation)... when you request Page/13/Page-Title, Apache tries to find a matching file in the current/root directory that matches the basename Page, by trying various extensions that would return the appropriate mime-type. This occurs before mod_rewrite is able to rewrite your friendly URL. So, MultiViews ends up rewriting your request to Page.php without passing any of the URL params (the rest of the URL will likely be seen as PATH_INFO), hence your "Undefined index" PHP notice.

(Although you should also be checking for the existence of this $_GET variable in your PHP script, which you don't seem to be doing.)

Options +Indexes +Includes +FollowSymLinks +MultiViews

It looks like you may have a conflict with MultiViews. Try removing +MultiViews from your server config (above), and/or disable MultiViews at the top of your .htaccess:

 Options -Indexes -MultiViews

MutliViews is disabled on a default Apache install, however, some (shared) hosts do seem to enable it.

The effect of MultiViews is noticeable because you have effectively removed the file extension to create your user-friendly URLs.

With MultiViews enabled (part of mod_negotiation)... when you request Page/13/Page-Title, Apache tries to find a matching file in the current/root directory that matches the basename Page, by trying various extensions that would return the appropriate mime-type. This occurs before mod_rewrite is able to rewrite your friendly URL. So, MultiViews ends up rewriting your request to Page.php without passing any of the URL params (the rest of the URL will likely be seen as PATH_INFO), hence your "Undefined index" PHP notice.

(Although you should also be checking for the existence of this $_GET variable in your PHP script, which you don't seem to be doing.)

Options +Indexes +Includes +FollowSymLinks +MultiViews

Why are you explicitly enabling MultiViews in your server config? This is likely the cause of your problem. Try removing +MultiViews from your server config (above), and/or disable MultiViews at the top of your .htaccess:

 Options -Indexes -MultiViews

MutliViews is disabled on a default Apache install, however, some (shared) hosts do seem to enable it. So, disabling it in .htaccess as a matter of course is probably recommended.

(But also, why are you enabling Includes - is this really necessary? Since you are using PHP, this is unlikely.)

The effect of MultiViews is noticeable because you have effectively removed the file extension to create your user-friendly URLs.

With MultiViews enabled (part of mod_negotiation)... when you request Page/13/Page-Title, Apache tries to find a matching file in the current/root directory that matches the basename Page, by trying various extensions that would return the appropriate mime-type. This occurs before mod_rewrite is able to rewrite your friendly URL. So, MultiViews ends up rewriting your request to Page.php without passing any of the URL params (the rest of the URL will likely be seen as PATH_INFO), hence your "Undefined index" PHP notice.

(Although you should also be checking for the existence of this $_GET variable in your PHP script, which you don't seem to be doing.)

Added reference to question, reworded accordingly.
Source Link
MrWhite
  • 43.1k
  • 4
  • 50
  • 90
Options +Indexes +Includes +FollowSymLinks +MultiViews

It looks like you may have a conflict with MultiViews. Try disablingremoving +MultiViews from your server config (above), and/or disable MultiViews at the top of your .htaccess file:

 Options -Indexes -MultiViews
  

MutliViews is disabled on a default Apache install, however, manysome (shared) hosts do seem to enable it for some reason. (It can make simple things - like extensionless URLs - appear to work like magic. However, it can result in confusion for many developers that try to do more complex things with mod_rewrite etc.)

The effect of MultiViews is noticeable because you have effectively removed the file extension to create your user-friendly URLs.

With MultiViews enabled (part of mod_negotiation)... when you request Page/13/Page-Title, Apache tries to find a matching file in the current/root directory that matches the basename Page, by trying various extensions that would return the appropriate mime-type. This occurs before mod_rewrite is able to rewrite your friendly URL. So, MultiViews ends up rewriting your request to Page.php without passing any of the URL params (the rest of the URL will likely be seen as PATH_INFO), hence your "Undefined index" PHP notice.

(Although you should also be checking for the existence of this $_GET variable in your PHP script, which you don't seem to be doing.)

It looks like you may have a conflict with MultiViews. Try disabling MultiViews at the top of your .htaccess file:

 Options -Indexes -MultiViews
 

MutliViews is disabled on a default Apache install, however, many (shared) hosts do seem to enable it for some reason. (It can make simple things - like extensionless URLs - appear to work like magic. However, it can result in confusion for many developers that try to do more complex things with mod_rewrite etc.)

The effect of MultiViews is noticeable because you have effectively removed the file extension to create your user-friendly URLs.

With MultiViews enabled (part of mod_negotiation)... when you request Page/13/Page-Title, Apache tries to find a matching file in the current/root directory that matches the basename Page, by trying various extensions that would return the appropriate mime-type. This occurs before mod_rewrite is able to rewrite your friendly URL. So, MultiViews ends up rewriting your request to Page.php without passing any of the URL params (the rest of the URL will likely be seen as PATH_INFO), hence your "Undefined index" PHP notice.

(Although you should also be checking for the existence of this $_GET variable in your PHP script, which you don't seem to be doing.)

Options +Indexes +Includes +FollowSymLinks +MultiViews

It looks like you may have a conflict with MultiViews. Try removing +MultiViews from your server config (above), and/or disable MultiViews at the top of your .htaccess:

 Options -Indexes -MultiViews
 

MutliViews is disabled on a default Apache install, however, some (shared) hosts do seem to enable it.

The effect of MultiViews is noticeable because you have effectively removed the file extension to create your user-friendly URLs.

With MultiViews enabled (part of mod_negotiation)... when you request Page/13/Page-Title, Apache tries to find a matching file in the current/root directory that matches the basename Page, by trying various extensions that would return the appropriate mime-type. This occurs before mod_rewrite is able to rewrite your friendly URL. So, MultiViews ends up rewriting your request to Page.php without passing any of the URL params (the rest of the URL will likely be seen as PATH_INFO), hence your "Undefined index" PHP notice.

(Although you should also be checking for the existence of this $_GET variable in your PHP script, which you don't seem to be doing.)

Source Link
MrWhite
  • 43.1k
  • 4
  • 50
  • 90

It looks like you may have a conflict with MultiViews. Try disabling MultiViews at the top of your .htaccess file:

 Options -Indexes -MultiViews

MutliViews is disabled on a default Apache install, however, many (shared) hosts do seem to enable it for some reason. (It can make simple things - like extensionless URLs - appear to work like magic. However, it can result in confusion for many developers that try to do more complex things with mod_rewrite etc.)

The effect of MultiViews is noticeable because you have effectively removed the file extension to create your user-friendly URLs.

With MultiViews enabled (part of mod_negotiation)... when you request Page/13/Page-Title, Apache tries to find a matching file in the current/root directory that matches the basename Page, by trying various extensions that would return the appropriate mime-type. This occurs before mod_rewrite is able to rewrite your friendly URL. So, MultiViews ends up rewriting your request to Page.php without passing any of the URL params (the rest of the URL will likely be seen as PATH_INFO), hence your "Undefined index" PHP notice.

(Although you should also be checking for the existence of this $_GET variable in your PHP script, which you don't seem to be doing.)