htaccess help and base url php

Asked

Viewed 298 times

1

I am trying to make url friendly with baseurl class and also with htaccess, but some pages like services and portfolio, are bugged, when I click to see the code appears in the file path a part of the page name , as examples

locahost/admin/port.. /Assets........

locahost/admin/s. /Assets........

Already delete the file and refiz, but it remains the same thing, I compared with the other pages and ta the same thing, follows the code of htaccess

RewriteEngine On
DirectoryIndex index.php
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewiteRule ^(.*)$ index.php?page=$1

Could you help me?

1 answer

0

Please try this:

Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d [OR]
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php?page=$1 [QSA,L]

I had a very similar problem and after a long time of research and with the help of some documents referring to the ache I reached the code above.

  • 1

    Could you explain what your code differs from the author’s code? The only thing I see that differs is a [OR] for symbolic links and you took the MultiViews, could you explain how this solves the problem? I recommend you read: http://answall.com/help/how-to-answer

  • Please read the Apache documentation before registering a review.

  • 1

    I have read and understand the documentation, the problem is to provide an answer within the community quality standard as the link indicates: http://answall.com/help/how-to-answer - is not a negative but constructive criticism. The problem here has nothing to do with the documentation but rather you haven’t explained how the code works, which is relevant to the answer.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.