View previous topic :: View next topic |
Author |
Message |
puertoblack2003 -
Joined: 08 Oct 2006 Posts: 87
|
Posted: Thu Aug 16, 2007 8:39 pm Post subject: Understanding Mod-Rewrite |
|
|
well guys I'm banging my head on the table understanding this mod-rewrite and yes i did read the tutorial and tried to implement it.but I'm using this vbseo program and it has alot of stuff that through me off for the mod-rewrite rules.
Is there another way of understanding this for a novice person
here is an example of re-write
Quote: | # Comment the following line (add '#' at the beginning)
# to disable mod_rewrite functions.
# Please note: you still need to disable the hack in
# the vBSEO control panel to stop url rewrites.
RewriteEngine On
# Some servers require the Rewritebase directive to be
# enabled (remove '#' at the beginning to activate)
# Please note: when enabled, you must include the path
# to your root vB folder (i.e. RewriteBase /forums)
#RewriteBase /
#RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com
#RewriteRule (.*) http://www.yourdomain.com/forums/$1 [L,R=301]
RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
RewriteCond %{QUERY_STRING} !vbseourl=
RewriteCond %{REQUEST_URI} !(admincp/|modcp/|chat|cron)
RewriteRule ^(.*\.php)$ vbseo.php?vbseourl=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !\.(jpg|gif)$
RewriteRule ^(archive/.*)$ vbseo.php?vbseourl=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !^(admincp|modcp|clientscript|cpstyles|images)/
RewriteRule ^(.+)$ vbseo.php?vbseourl=$1 [L,QSA]
|
i think i have the http_Host part done but the other rest I'm stuck on it.HELP please |
|
Back to top |
|
|
Arctic -
Joined: 24 Sep 2004 Posts: 560
|
Posted: Fri Aug 17, 2007 4:12 am Post subject: |
|
|
Isn't this Apache? Abyss uses URL rewriting from the panel, right...? |
|
Back to top |
|
|
pkSML -
Joined: 29 May 2006 Posts: 952 Location: Michigan, USA
|
Posted: Fri Aug 17, 2007 4:11 pm Post subject: |
|
|
puertoblack2003, are you asking how to convert these mod-rewrite directives into Abyss' URL rewriting scheme? _________________ Stephen
Need a LitlURL?
http://CodeBin.yi.org |
|
Back to top |
|
|
puertoblack2003 -
Joined: 08 Oct 2006 Posts: 87
|
Posted: Fri Aug 17, 2007 9:53 pm Post subject: |
|
|
pkSML wrote: | puertoblack2003, are you asking how to convert these mod-rewrite directives into Abyss' URL rewriting scheme? |
yes, i tired according to the tutorial that was provided but some of the directives had confused me trying to configure it the http_host part i got but the rest..i was stuck on.
Is there a novice way of doing it? |
|
Back to top |
|
|
pkSML -
Joined: 29 May 2006 Posts: 952 Location: Michigan, USA
|
Posted: Sat Aug 18, 2007 2:29 am Post subject: |
|
|
One quick question: where is the forum located? Is it in the root folder of the website? I'm going to assume so.
Code: | RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L] |
This one would translate as follows:
Virtual Path Regular Expression: Code: | ^/(urllist|sitemap_)(.*)(.)(xml|txt|gz)$ |
Case sensitive: un-checked
If this rule matches: Perform an internal redirection
Redirect to: Code: | /vbseo_sitemap/vbseo_getsitemap.php?sitemap=$2 |
Append query string: doesn't matter
Escape redirection location: checked
Next Action: stop matching _________________ Stephen
Need a LitlURL?
http://CodeBin.yi.org |
|
Back to top |
|
|
pkSML -
Joined: 29 May 2006 Posts: 952 Location: Michigan, USA
|
|
Back to top |
|
|
puertoblack2003 -
Joined: 08 Oct 2006 Posts: 87
|
Posted: Sat Aug 18, 2007 1:41 pm Post subject: |
|
|
you've been a great help thanks...time to study :) |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Mon Aug 20, 2007 12:07 am Post subject: Re: Understanding Mod-Rewrite |
|
|
puertoblack2003 wrote: | Code: |
#RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com
#RewriteRule (.*) http://www.yourdomain.com/forums/$1 [L,R=301]
|
|
The HTTP_HOST part (as you call it ;-) ) is commented (preceded with #) so it is not actually used by the original configuration and you can safely ignore it.
If you'd to include it:
* the virtual path regular expression will be (.*)
* the condition will be "variable HTTP_HOST is not equal to www.yourdomain.com"
* Action: perform external redirection to
* Redirect to: http://www.yourdomain.com/forums/$1
* Status code: 301
* Next action: stop matching _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
puertoblack2003 -
Joined: 08 Oct 2006 Posts: 87
|
Posted: Wed Aug 22, 2007 8:06 pm Post subject: |
|
|
thanks aprelium i thought that had to be added.. |
|
Back to top |
|
|
|