apache - Can we use httpd.conf instead of .htaccess for clean URL? -
i have read setting changes in httpd.conf much improve compared making changes in .htaccess later 1 parsed @ runtime while .conf parsed @ time of starting apache. so, possible have .htaccess functionality in httpd.conf or there few things have done in .htaccess only.
also, can suggest how debug clean url issues?
basically, not able clean url working. can access show.php file not able access variables. here .conf settings.
rewriteengine on rewritecond %{http_host} !^www\.example\.com [nc] rewritecond %{http_host} !^$ rewriterule ^/show/([^/\.]+)/([^/\.]+) http://www.example.com/show.php?id=$1&img=$2 [l,r] i have added
options indexes multiviews followsymlinks allowoverride in <directory "/var/www/html">
thanks.
as stated in apache manual on .htaccess, can set in .htaccess file can set within <directory> block within httpd.conf improve efficiency.
as issues rewriting url, first rewritecond appears matching urls aren't www.example.com (the ! in front end negation modifier). remove ! , see if fixes issue. (you should remove sec rewritecond well, until have first 1 matching; otherwise, debugging problems more difficult.)
.htaccess apache httpd.conf clean-urls
No comments:
Post a Comment