Check For Module Presence in .htaccess
One of my favorite Apache modules is mod_rewrite. mod_rewrite allows me to manipulate page URLs so that I can search engine friendly URLs. Not every Apache server has the mod_rewrite module installed so you will want to add a conditional statement within your .htaccess file to make sure it's there.
The .htaccess
#Wordpress's .htaccess code
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
If the "mod_rewrite.c" module is present, that means that mod_rewrite is available and will be used. If not, the mod_rewrite code will be ignored. Using this conditional statement will prevent 500 Internal Server Errors.
I love almost every part of being a tech blogger: learning, preaching, bantering, researching. The one part about blogging that I absolutely loathe: dealing with SPAM comments. For the past two years, my blog has registered 8,000+ SPAM comments per day. PER DAY. Bloating my database...
Firefox OS is all over the tech news and for good reason: Mozilla's finally given web developers the platform that they need to create apps the way they've been creating them for years -- with CSS, HTML, and JavaScript. Firefox OS has been rapidly improving...
It's something that makes all men live in fear, and are often uncertain of. It's never spoken, but the curiosity is always there. Nine out of ten women agree in the affirmative. Advertisers do their best to make us feel inadequate but...
So what is the fallback for when it is not available? If you do this you need to make sure your code has a way to handle it, especially if your mod_rewrite conditions are passing get vars.
I personally would like to know about a 500 server error so that I could fix the problem.
Would it be fine to include this code into httpd.conf itself?
Or is that a bad idea?
Thanks David.
Nope, the answer is it is bad idea because, Rewrite Base is only valid per-directory config files.
:D
how to make a link like this rerwiteRule index.php? module = article & id = 5
thanks