.htaccess rewrite issues with homepage
I have the following rewrite rule:
RewriteEngine on
RewriteRule ^([^/]+)/?$ parser.php?id=$1 [QSA,L]
The issue is that when I try to access my homepage by www.site.com, it rewrites it as well to parser.php, why is this and how do I prevent this?
Exempt the root from the rewrite:
RewriteEngine on
# Allow the rewrite to proceed only if the URI does *not* match this pattern
# The pattern used is ^/$ - this will only match the exact string "/" for the root.
RewriteCond %{REQUEST_URI} !^/$
# Your existing rule
RewriteRule ^([^/]+)/?$ parser.php?id=$1 [QSA,L]
Check more discussion of this question.
Related posts:
Leave a comment
Recent Posts
- Understanding redundant power supplies
- Is there a way for administrators to disable users from installing Firefox extensions?
- Is there research material on NTP accuracy available?
- How to create a limited “domain admin” that does not have access to domain controllers?
- Can Windows RDC admin users be immune from being kicked?
Tags
active-directory
amazon-ec2
apache
apache2
backup
bash
centos
cisco
command-line
debian
dns
email
exchange
firewall
iis
iis7
iptables
linux
macosx
monitoring
mysql
networking
nginx
performance
permissions
php
postfix
raid
security
sql-server
sql-server-2005
sql-server-2008
ssh
ssl
ubuntu
unix
virtualization
vpn
webserver
windows
windows-7
windows-server-2003
windows-server-2008
windows-server-2008-r2
windows-xp





