Hello, this is an url rewrite for my wiki page (site.com/wiki/article) RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^wiki/(.*)$ w/index.php?title=$1 [PT,L,QSA] RewriteRule ^wiki/*$ wiki/ [L,QSA] RewriteRule ^/*$ wiki/ [L,QSA] Code (markup): Now here I got an url rewrite to avoid duplicate content: RewriteCond %{HTTP_HOST} !^www\.site\.com$ RewriteRule ^(.*)$ http://www.site.com/$1 [L,R=301] Code (markup): Can you somehow combine them in 1 .htaccess file? If I just put them together it doesen´t work. Thanks for your help.
Ok since nobody is doing that for free, I´m offering the service here (5500 posts, backlinks worth $10) for the person who gives me a working code from the above one time for free. Greetings AllOutAnime
RewriteEngine On RewriteCond %{HTTP_HOST} ^site\.com$ [NC] RewriteRule ^(.*)$ http://www.site.com/$1 [R=301,L] <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^wiki/(.*)$ w/index.php?title=$1 [PT,L,QSA] RewriteRule ^wiki/*$ wiki/ [L,QSA] RewriteRule ^/*$ wiki/ [L,QSA] </IfModule>
I'm not a mod_rewrite expert, but I highly doubt the <ifModule mod_rewrite.c> statement is even necessary. Feel free to correct me if I'm wrong, but bear in mind I know not one but two mod_rewrite experts and I will be consulting with both of them just to make sure.
but i thought it was the best way to merge the statements...I use it on my Wordpress .htaccess and it works...
yep I think you're right, but i used the above code on my site and it worked..although alloutanime guy didn't say if it worked for him!