Working with database sites, my issue right now is that say my database-driven site URL is www.mysite.com, my .htaccess is currently set up that it returns a 200 (Successful) header on any request (e.g. complete gibberish like www.mysite.com/sdjgdsfklr). I've heard this is bad for SEO.
I'm trying to rewrite my .htaccess so that only requests in certain formats get redirected to index.php.
My URL's are formatted like: data1-data2-data3.html and data1-data2-data3-data4.html. URLs formatted anyway else should not exist. Therefore, I tried using the following lines of code to send correctly formatted URLs to index.php to generate a page, and everything else to return a 404.
The code didn't have the fully desired effect, it only passes the first (.*). I'd like it to pass the entire string between the anchors ^ and $ (the (.*)-(.*)-(.*)).
If anyone could offer some guidance on what I could do to have the .htaccess pass the entire string as the backreference $1, that would be greatly appreciated.
I'm trying to rewrite my .htaccess so that only requests in certain formats get redirected to index.php.
My URL's are formatted like: data1-data2-data3.html and data1-data2-data3-data4.html. URLs formatted anyway else should not exist. Therefore, I tried using the following lines of code to send correctly formatted URLs to index.php to generate a page, and everything else to return a 404.
Code:
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)-(.*)-(.*).html$ index.php?q=$1
If anyone could offer some guidance on what I could do to have the .htaccess pass the entire string as the backreference $1, that would be greatly appreciated.