keyword-urls-mod_2.3.1 rewriterule

Discussions and support about the different URL Rewriting techniques for phpBB2.

Moderator: Moderators

keyword-urls-mod_2.3.1 rewriterule

Postby mayberry » Wed May 31, 2006 6:50 pm

[english support]

When I try to access a directory other than the root I get 404 errors.

Ex: root/dir1/dir2/file.html = 404

I removed this line > RewriteRule ^.+/([^/]+\.html)$ /$1 [R=301,L] < from the htaccess and now it works, but I dont know why.

What does that line do? Is it required to be there? (I know nothing about apache rewrites.)

Thanks.
mayberry
 
Posts: 1
Joined: Wed May 31, 2006 6:38 pm

Advertisement

Postby dcz » Wed May 31, 2006 7:15 pm

Hello ;)

This rule is here to prevent what I call virtual folder injection and that's exactly the one disturbing you here.

It prevents url like this www.example.com/phpBB/virtualfolder/top ... -vtxx.html to work, thus breaking all images paths and performing many 404's on the server.

With this rule, this extra folder will just get removed.

Then, this mean that anything ending with .html within a sub folder located under the one where this rule is set won't work.

You can either get rid of this additional protection or try something like :

Code: Select all
RewriteCond %{REQUEST_URI} !/(folder1|folder2|folder3|...) [NC]
RewriteRule ^.+/([^/]+\.html)$ /$1 [R=301,L]


Where folder1,2,3 would be your folder containing .html content.

Then, as I told you on phpbb-fr.com, you should consider updating to one of the phpBB SEO mod Rewrites, the advanced one will keep the same url standard, but will eventually need some small adaptation, so pleas start a new thread if you want to migrate. The required steps are easy and already achieved in the french forum.

Reason to migrate : a faster code and a nicely rewritten pagination without any duplicates ;)

As well, once you will have decided yourself on this, and if not done already, you should look at the mx Google SitemapsAnd mx Sitemaps modules, they both support all phpBB SEO mod Rewrites as well as many others ;)

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21238
Joined: Fri Apr 28, 2006 9:03 pm


Return to phpBB2 mod Rewrite

Who is online

Users browsing this forum: No registered users and 1 guest