apache2 and htaccess help
Posted
by
user1052448
on Pro Webmasters
See other posts from Pro Webmasters
or by user1052448
Published on 2011-11-18T18:42:10Z
Indexed on
2011/11/19
2:09 UTC
Read the original article
Hit count: 224
For some reason domain.com/YYYY-MM-DD redirects to domain.com/var/htdocs/public_html
RewriteEngine On
RewriteCond %{HTTP_HOST} ^[^\./]+\.[^\./]+$
RewriteRule ^/(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^archive/index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^. /archive/index.php [L]
trying to get anything after www.domain.com other than index.php and archive/index.php to display mysql content on archive/index.php (by grabbing PHP Request URI). The browser URL should remain www.domain.com/YYYY/MM/DD/blog-title or www.domain.com/YYYY/MM/ to display all posts from YYYY-MM
© Pro Webmasters or respective owner