php - URL rewriting using old .htaccess rules -


i having real problems re-writing urls , massively appreciated.

i have php file called share.php , .htaccess file containing following rule:

rewriterule ^share/([^/\.]+)/?$ share.php?variable=$1&%{query_string} [l] 

if navigate domain.com/share/123456, share.php page loaded, there no value in $_get['variable']. have other rewrite rules in .htaccess file , thought there may problem them, removed of other rules. 1 of rules removed rewriting domain.com/preview domain.com/preview.php

rewriterule ^preview/?$ preview.php?&%{query_string} [l] 

i noticed that, of other rules removed, if navigated domain.com/preview, still rewrite url preview.php.

so, removed .htaccess file completely, restarted apache, cleared cache in firefox , tested again. though .htaccess file has been deleted, rules still work. domain.com/preview still redirects domain.com/preview.php , domain.com/share/123456 still redirects domain.com/share.php(with no data in $_get['variable']).

2 domains point @ server, there no rewrite rules in of .conf files , there no longer .htaccess files. have tried putting rewrite rules in .conf file domain instead, same issue.

modrewrite showing loaded module if run phpinfo(). here .conf file domain:

<virtualhost *:80>     serveradmin webmaster@localhost     servername domain.com     serveralias www.domain.com      documentroot /home/www/domain.com/public_html     <directory />         options followsymlinks         allowoverride     </directory>     <directory /home/www/>         options indexes followsymlinks multiviews         allowoverride         require granted     </directory>      scriptalias /cgi-bin/ /usr/lib/cgi-bin/     <directory "/usr/lib/cgi-bin">         allowoverride         options +execcgi -multiviews +symlinksifownermatch         require granted     </directory>      errorlog ${apache_log_dir}/error.log      # possible values include: debug, info, notice, warn, error, crit,     # alert, emerg.     loglevel warn      customlog ${apache_log_dir}/access.log combined      alias /doc/ "/usr/share/doc/"     <directory "/usr/share/doc/">         options indexes multiviews followsymlinks         allowoverride     require denied         allow 127.0.0.0/255.0.0.0 ::1/128     </directory> </virtualhost> 

i've been trying sort out afternoon , can't see what's wrong! can point me in right direction?

i @ loss start troubleshooting this. turned on rewrite logging, nothing comes in log files.

i running apache 2.4.9 on ubuntu 12.04 php 5.5.10.

in domain configuration, multiviews option of mod_negotiation enabled. reference options may helpful. describe , don't want happen. processing of takes place before evaluating rewrite rules, may related problem.

you can disable behaviour removing multiviews option domain configuration or adding following line .htaccess file:

options -multiviews 

also, should use qsa flag (for query string append) instead of appending %{query_string} manually.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -