REALLY Simple Mod_Rewrite - As In Not Using ACP Ability

phpBB3 SEO Simple mod Rewrite support forum. This mods performs URL rewriting for phpBB3 in a static way.

Moderator: Moderators

REALLY Simple Mod_Rewrite - As In Not Using ACP Ability

Postby mdvaldosta » Sat Jan 05, 2008 6:39 pm

I want to use the simple mod_rewrite for phpBB3 but I'd like to be able to do this without having any of the ACP options configurable (as in hard coding them). Didn't seem easy to do so I tried doing this via .htaccess

Code: Select all
RewriteRule ^forum([0-9]+)\.html$ /viewforum.php?f=$1 [QSA,L]
RewriteRule ^forum([0-9]+)-([0-9]+)\.html$ /viewforum.php?f=$1&start=$2 [QSA,L]
RewriteRule ^topic([0-9]+)\.html$ /viewtopic.php?f=$1 [QSA,L]
RewriteRule ^topic([0-9]+)-([0-9]+)\.html$ /viewtopic.php?f=$1&start=$2 [QSA,L]


For example. However, the url's do not display as rewritten doing only this (although they do return the proper page if you type the rewritten url into the browser).

Suggestions for someone in my situation?
mdvaldosta
 
Posts: 3
Joined: Sat Jan 05, 2008 6:31 pm

Advertisement

Postby SeO » Sat Jan 05, 2008 7:36 pm

Topic moved to the simple mod rewrite forum.

You can just not install the ACP and configure all the options in the phpbb_seo_class.php file :

Code: Select all
      $this->seo_opt = array( 'url_rewrite' => false,
         'profile_inj' => false,
         'profile_noids' => false,
         'rewrite_usermsg' => false,
         'rem_sid' => false,
         'rem_hilit' => true,
         'rem_small_words' => false,
         'virtual_folder' => false,
         'virtual_root' => false,
         'cache_layer' => true, // Forum url caching, by default
         'rem_ids' => false,
      );

Just set :

Code: Select all
         'cache_layer' => false, // Forum url caching, by default


To fully bypass the cache (used to store the settings as well) and set other option as you need.

Or you could install the ACP (with the phpbb_seo_install.php file), configure the mod with cache on, and then uninstall the ACP.

The cache file would stay active and would keep your settings.
This looks like the best solution to be able to generate a personalised .htaccess (working with your options) before you drop the ACP.
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Postby mdvaldosta » Sat Jan 05, 2008 8:36 pm

Installing via the ACP isn't an option for my situation. It'd have to be installed via file edits only. It's unfortunate there's not an easy way (like on phpBB2) to just edit .htaccess and a couple files : /
mdvaldosta
 
Posts: 3
Joined: Sat Jan 05, 2008 6:31 pm

Postby SeO » Sun Jan 06, 2008 1:21 am

But you can, as I told you. All the option are hard coded in phpbb_seo_class.php, you can just change the default values from there.

About the .htaccess it depends, the profile, groups and search user page url can be rewritten into several ways.
If you keep :
Code: Select all
         'profile_inj' => false,
         'profile_noids' => false,
         'rewrite_usermsg' => false,


You will need :
Code: Select all
# Lines That should already be in your .htacess
<Files "config.php">
Order Allow,Deny
Deny from All
</Files>
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>

# You may need to un-comment the following line
# Options +FollowSymlinks
# REMEBER YOU ONLY NEED TO STARD MOD REWRITE ONCE
RewriteEngine On
# REWRITE BASE
RewriteBase /
# HERE IS A GOOD PLACE TO ADD THE WWW PREFIXE REDIRECTION

#####################################################
# PHPBB SEO REWRITE RULES - SIMPLE
#####################################################
# AUTHOR : dcz www.phpbb-seo.com
# STARTED : 01/2006
#################################
# FORUMS PAGES
###############
# FORUM INDEX REWRITERULE WOULD STAND HERE IF USED. 'forum' REQUIRES TO BE SET AS FORUM INDEX
# RewriteRule ^phpbb/forum\.html$ /phpbb/index.php [QSA,L,NC]
# FORUM
RewriteRule ^phpbb/forum([0-9]+)(-([0-9]+))?\.html$ /phpbb/viewforum.php?f=$1&start=$3 [QSA,L,NC]
# TOPIC WITH VIRTUAL FOLDER
RewriteRule ^phpbb/forum([0-9]+)/topic([0-9]+)(-([0-9]+))?\.html$ /phpbb/viewtopic.php?f=$1&t=$2&start=$4 [QSA,L,NC]
# GLOBAL ANNOUNCES WITH VIRTUAL FOLDER
RewriteRule ^phpbb/announces/topic([0-9]+)(-([0-9]+))?\.html$ /phpbb/viewtopic.php?t=$1&start=$3 [QSA,L,NC]
# TOPIC WITHOUT FORUM ID & DELIM
RewriteRule ^phpbb/[a-z0-9_-]*/?topic([0-9]+)(-([0-9]+))?\.html$ /phpbb/viewtopic.php?t=$1&start=$3 [QSA,L,NC]
# PROFILES SIMPLE
RewriteRule ^phpbb/member([0-9]+)\.html$ /phpbb/memberlist.php?mode=viewprofile&u=$1 [QSA,L,NC]
# USER MESSAGES SIMPLE
RewriteRule ^phpbb/messages([0-9]+)(-([0-9]+))?\.html$ /phpbb/search.php?author_id=$1&sr=posts&start=$3 [QSA,L,NC]
# GROUPS SIMPLE
RewriteRule ^phpbb/group([0-9]+)(-([0-9]+))?\.html$ /phpbb/memberlist.php?mode=group&g=$1&start=$3 [QSA,L,NC]
# POST
RewriteRule ^phpbb/post([0-9]+)\.html$ /phpbb/viewtopic.php?p=$1 [QSA,L,NC]
# THE TEAM
RewriteRule ^phpbb/the-team\.html$ /phpbb/memberlist.php?mode=leaders [QSA,L,NC]
# HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES

# END PHPBB PAGES
#####################################################


This .htaccess is meant to be used at the domain's root level, replace "phpbb/" with the real path to where phpBB is installed starting from the domain's root level (could be nothing).

Tell me in case you want to play with profiles and group options, I'll give you the additional rewriterules to use.
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Postby mdvaldosta » Sun Jan 06, 2008 7:54 pm

Will disabling the forum url caching decrease the performance of the rewrite, or is it only used to store the url settings? I'm about to give this a shot.
mdvaldosta
 
Posts: 3
Joined: Sat Jan 05, 2008 6:31 pm

Postby dcz » Mon Jan 07, 2008 10:34 am

In simple mod, the cache is only used to store the mod rewrite settings, with mixed and advanced it will additionally store the personalized forum urls.

So there is no difference in simple mod if you hard code the settings in the phpbb_seo_class.php file.

Maybe you should give a try to the premod on a local server to find out more about all our mods at once.

++
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: 21219
Joined: Fri Apr 28, 2006 9:03 pm

Postby angeleyess » Thu Jun 12, 2008 11:00 am

Hello;

I have installed the phpbb3 seo simple mod rewrite and I can not change the options on ACP for ACP_PHPBB_SEO_CLASS for example I set the YES option for Active URL Rewriting aand save but when I turn back, the No option is set.

My site is here : http://gizemsehri.com/viewforum.php?f=5 note the url
when I put .html after this url http://gizemsehri.com/viewforum.php?f=5.html it is shown again but how can fix it to be .html ???
angeleyess
 
Posts: 5
Joined: Sat Jun 07, 2008 10:20 am

Postby HB » Thu Jun 12, 2008 11:41 am

angeleyess wrote:I have installed the phpbb3 seo simple mod rewrite and I can not change the options on ACP for ACP_PHPBB_SEO_CLASS for example I set the YES option for Active URL Rewriting aand save but when I turn back, the No option is set.

Is the cache directory writable (777)?
Dan Kehn
HB
phpBB SEO Team
phpBB SEO Team
 
Posts: 1211
Joined: Mon Oct 16, 2006 2:25 am

Postby angeleyess » Thu Jun 12, 2008 11:49 am

HB wrote:Is the cache directory writable (777)?


Yes, it is writtable.
angeleyess
 
Posts: 5
Joined: Sat Jun 07, 2008 10:20 am

Postby HB » Thu Jun 12, 2008 12:12 pm

I mean this one:

<yourforum>/phpbb_seo/cache/

It should include three files (phpbb_cache.php, phpbb_cache.php.old, phpbb_cache.php.current). Your settings are stored in the first one, phpbb_cache.php.
Dan Kehn
HB
phpBB SEO Team
phpBB SEO Team
 
Posts: 1211
Joined: Mon Oct 16, 2006 2:25 am

Postby angeleyess » Thu Jun 12, 2008 12:17 pm

HB wrote:I mean this one:

<yourforum>/phpbb_seo/cache/

It should include three files (phpbb_cache.php, phpbb_cache.php.old, phpbb_cache.php.current). Your settings are stored in the first one, phpbb_cache.php.


I mean the same, I have the cache placed in phpbb_seo directory but it includes no file, it is empty :shock:
angeleyess
 
Posts: 5
Joined: Sat Jun 07, 2008 10:20 am

Postby angeleyess » Thu Jun 12, 2008 1:22 pm

Ohhh.. I asked too my host server, I use windows hosting it does not run .htaccess so what should I do with IIS :cry:
angeleyess
 
Posts: 5
Joined: Sat Jun 07, 2008 10:20 am

Postby HB » Thu Jun 12, 2008 3:08 pm

Sorry, I've never used IIS. Google turned up lots of articles on the subject:

http://www.google.com/search?q=iis+url+rewriting
Dan Kehn
HB
phpBB SEO Team
phpBB SEO Team
 
Posts: 1211
Joined: Mon Oct 16, 2006 2:25 am

Postby angeleyess » Thu Jun 12, 2008 3:10 pm

Thank you for your good idea :)
angeleyess
 
Posts: 5
Joined: Sat Jun 07, 2008 10:20 am

Postby SeO » Thu Jun 12, 2008 4:18 pm

Try as well to local search, the IIS + isapi_rewrite implementation is covered for our mods.
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm


Return to Simple SEO URL

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: Alexa [Bot] and 1 guest