htaccess empty search query
-
Hi all you great people,
I have a special setup in my htaccess for two reasons:
a) To catch empty search strings
b) To view a specific pageA guy helped me once with this, but now I can’t figure out what’s wrong.
There are two lines added to my htaccess file:
RewriteCond %{QUERY_STRING} ^s=$ RewriteRule . /index.php
So right now I have this in my htaccess file for wordpress:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{QUERY_STRING} ^s=$ RewriteRule . /index.php RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php </IfModule> # END WordPress
I have then modified my 404.php with the following:
This was an easy way out and well, it did its job previously.<?php get_header(); if($_SERVER['REQUEST_URI'] == '/s='){ ?> <!-- Empty Search Results --> <div id="content"> etc.... <!-- Empty Search Results End Here --> <?php }else{ ?> <!-- Page Not Found --> <div id="content"> etc.... <!-- Page Not Found End here --> <?php } get_footer(); ?>
Now when I do an empty search, I get a 500 Internal Server Error.
Are anyone able to help me out?
Thanks & Regards,
Kenn Nielsen
Denmark
Viewing 14 replies - 1 through 14 (of 14 total)
Viewing 14 replies - 1 through 14 (of 14 total)
- The topic ‘htaccess empty search query’ is closed to new replies.