php - htaccess: rewriting with index parameter doesn't work properly -


alright, i'm struggling right now, i've tried everything, read articles , tutorials still don't know why doesn't work.

i've got index.php file:

echo "some test"; if(isset($para)) {     include $para . '.php'; } else {     echo "there's no parameter"; } 

so if user views page parameter 'home' (http://mypage.com/test/index.php?para=home), he'll correct page. work.

.htaccess:

directoryindex index.php rewriteengine on rewritecond %{http_host} ^mypage.com$ [nc] rewriterule ^(.*)$ http://mypage.com/test/$1 [r=301,l] rewritebase /test/ rewriterule ^([a-z]+)$ index.php?para=$1 

but when try navigate using rewritten link (http://mypage.com/test/home), browser outputs included file , ignores index.php , content.

is there wrong htaccess file? or need change server configuration? because had different htaccess file on different webserver , worked without issues. didn't work on webserver i'm using right (sadly, have access htdocs folder).

edit: checked phpinfo, page running on php 5.3.28 on apache2.

solved!

problem solved. adding 'options -multiviews' fixed issue.

the hint here is:

the browser outputs included file , ignores index.php , content.

try disabling mod_negotiation (options -multiviews) in context want remapping mod_rewrite , within script.

mod_negotiation common reason "other" rewriting seems happening on resources.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -