htaccess and sitemap/rss

The GYM Sitemaps & RSS module for phpBB. Sitemaps and RSS feeds for Google Yahoo! and MSN Live, support, add ons etc ...

Moderator: Moderators


htaccess and sitemap/rss

Postby tolmarc » Sat Nov 22, 2008 4:33 pm

Solution:
.htaccess wasn't in root folder.
/Solution

I've installed the GYM sitemaps & RSS, and it's a great mod. I've encoutenred a problem with the rewritng rules. I do not use any URL rewrite mods, so it's only for the sitemaps. I'm currently working on a localhost installation with XAMMP and MOD_REWRITE is enabled. my phpbb installation is in a folder called "community".

here is my htaccess:
Code: Select all
Options +FollowSymlinks
RewriteEngine on
RewriteBase /community/

#####################################################
# GYM Sitemaps & RSS
# Global channels
RewriteRule ^rss(/(news)+)?(/(digest)+)?(/(short|long)+)?/?$ /gymrss.php?channels&$2&$4&$6 [QSA,L,NC]
# HTML Global news & map
RewriteRule ^(news|maps)/?(page([0-9]+)\.html)?$ /map.php?$1&start=$3 [QSA,L,NC]
# END GYM Sitemaps & RSS
#####################################################


#####################################################
# GYM Sitemaps & RSS
# MTML Module additional modes
RewriteRule ^(news|maps)/([a-z0-9_-]+)(/([a-z0-9_-]+))?/?(page([0-9]+)\.html)?$ /map.php?$2=$4&$1&start=$6 [QSA,L,NC]
# Main feeds & channels
RewriteRule ^rss(/(news)+)?(/(digest)+)?(/(short|long)+)?(/([a-z0-9_-]+))?/([a-z0-9_]+)\.xml(\.gz)?$ /gymrss.php?$9=$8&$2&$4&$6&gzip=$10 [QSA,L,NC]
# Module feeds
RewriteRule ^[a-z0-9_-]*-[a-z]+([0-9]+)(/(news)+)?(/(digest)+)?(/(short|long)+)?/([a-z0-9_]+)\.xml(\.gz)?$ /gymrss.php?$8=$1&$3&$5&$7&gzip=$9 [QSA,L,NC]
# Module feeds without ids
RewriteRule ^([a-z0-9_-]+)(/(news)+)?(/(digest)+)?(/(short|long)+)?/([a-z0-9_]+)\.xml(\.gz)?$ /gymrss.php?nametoid=$1&$3&$5&$7&modulename=$8&gzip=$9 [QSA,L,NC]
# Google SitemapIndex
RewriteRule ^sitemapindex\.xml(\.gz)?$ /sitemap.php?gzip=$1 [QSA,L,NC]
# Module cat sitemaps
RewriteRule ^[a-z0-9_-]+-([a-z]+)([0-9]+)\.xml(\.gz)?$ /sitemap.php?module_sep=$1&module_sub=$2&gzip=$3 [QSA,L,NC]
# Module sitemaps
RewriteRule ^([a-z0-9_]+)-([a-z0-9_-]+)\.xml(\.gz)?$ /sitemap.php?$1=$2&gzip=$3 [QSA,L,NC]
# END GYM Sitemaps & RSS
#####################################################

anytime I try to show sitemap.xml, I get a 404 error. What am I missing here? thanks for the help.
Last edited by tolmarc on Tue Nov 25, 2008 9:09 pm, edited 1 time in total.
tolmarc
 
Posts: 5
Joined: Sat Nov 22, 2008 4:30 pm

Advertisement

Re: htaccess and sitemap/rss

Postby HB » Sun Nov 23, 2008 2:19 am

tolmarc wrote:I do not use any URL rewrite mods, so it's only for the sitemaps.

Meta-comment: Google doesn't care what the sitemap URLs look like, so why are you bothering? Anyway, something like this would work and alot easier to read then the above:

Code: Select all
RewriteRule ^sitemaps.xml$ /sitemap.php [QSA,L,NC]
Dan Kehn
HB
phpBB SEO Team
phpBB SEO Team
 
Posts: 1019
Joined: Mon Oct 16, 2006 2:25 am

Postby tolmarc » Sun Nov 23, 2008 8:39 am

HB, thx for the quick reply.

First of all I want to learn how this mod works, and actually I'm curious about integrating RSS feeds into the forum.

my .htaccess now is as follows:
Code: Select all
Options +FollowSymlinks
RewriteEngine on
RewriteBase /community/
RewriteRule ^sitemaps.xml$ /sitemap.php [QSA,L,NC]


And I still get 404. what else can I check?
tolmarc
 
Posts: 5
Joined: Sat Nov 22, 2008 4:30 pm

Postby SeO » Sun Nov 23, 2008 9:41 am

Would be better to keep the full .htaccess to be able to use every URL of GYM sitemaps properly.

This .htaccess is correct if used in www/community/, usually in this case, the right slash is not required and can even cause the 404 you're currently experimenting. Try to get rid of all of them, the first rewriterule :
RewriteRule ^rss(/(news)+)?(/(digest)+)?(/(short|long)+)?/?$ /gymrss.php?channels&$2&$4&$6 [QSA,L,NC]

Becomes :
RewriteRule ^rss(/(news)+)?(/(digest)+)?(/(short|long)+)?/?$ gymrss.php?channels&$2&$4&$6 [QSA,L,NC]


And so on.
SeO
Administrateur - Site Admin
Administrateur - Site Admin
 
Posts: 5527
Joined: Wed Mar 15, 2006 9:41 pm

Postby tolmarc » Tue Nov 25, 2008 3:00 pm

Thanks guys for all the help, but still no luck. I've edited the .htaccess and it still doesn't work. Should I check something else? maybe I'm missing something on the basic settings.

Maybe It has something to do to work with XAMMP? maybe it doesn't support URL REwrite?
tolmarc
 
Posts: 5
Joined: Sat Nov 22, 2008 4:30 pm

Postby HB » Tue Nov 25, 2008 3:14 pm

Out of the box XAMPP doesn't support rewrite. You must modify httpd.conf as shown below.

Code: Select all
...
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule rewrite_module modules/mod_rewrite.so
Dan Kehn
HB
phpBB SEO Team
phpBB SEO Team
 
Posts: 1019
Joined: Mon Oct 16, 2006 2:25 am

Postby tolmarc » Tue Nov 25, 2008 3:52 pm

Already did this before. Any simple check I can make in order to check that this is working fine?
A simple rewrite rule maybe? I'm have knowledge of php and phpbb, just not on htaccess rules.
tolmarc
 
Posts: 5
Joined: Sat Nov 22, 2008 4:30 pm

Postby SeO » Tue Nov 25, 2008 7:52 pm

http://www.phpbb-seo.com/boards/advance ... t1219.html
SeO wrote:To load mod Rewrite with Xampp :
Open <xampp-directory>/apache/conf/httpd.conf and replace :
Code: Select all
#LoadModule rewrite_module modules/mod_rewrite.so


With :
Code: Select all
LoadModule rewrite_module modules/mod_rewrite.so


And then :
Code: Select all
<Directory />
    Options FollowSymLinks
    AllowOverride none
    Order deny,allow
    Deny from all
</Directory>

With :
Code: Select all
<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
</Directory>


Simple test for mod rewrite : http://www.phpbb-seo.com/boards/apache- ... vt847.html

;)
SeO
Administrateur - Site Admin
Administrateur - Site Admin
 
Posts: 5527
Joined: Wed Mar 15, 2006 9:41 pm

[Solved]

Postby tolmarc » Tue Nov 25, 2008 9:08 pm

.htaccess wasn't in the root. I though I should put in /community/ folder.

by the way, how can offer RSS feed automatically for every forum, like the one in firefox address bar?
tolmarc
 
Posts: 5
Joined: Sat Nov 22, 2008 4:30 pm

Postby SeO » Thu Nov 27, 2008 7:32 pm

GYM sitemaps does, but you need to mod all your templates for them to show up, as explained in the install file.
SeO
Administrateur - Site Admin
Administrateur - Site Admin
 
Posts: 5527
Joined: Wed Mar 15, 2006 9:41 pm


Return to GYM Sitemaps & RSS




  • Similar topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: Google [Bot] and 2 guests