Understanding Mod-Rewrite

 
Post new topic   Reply to topic    Aprelium Forum Index -> URL Rewriting
View previous topic :: View next topic  
Author Message
puertoblack2003
-


Joined: 08 Oct 2006
Posts: 87

PostPosted: Thu Aug 16, 2007 8:39 pm    Post subject: Understanding Mod-Rewrite Reply with quote

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 View user's profile Send private message
Arctic
-


Joined: 24 Sep 2004
Posts: 560

PostPosted: Fri Aug 17, 2007 4:12 am    Post subject: Reply with quote

Isn't this Apache? Abyss uses URL rewriting from the panel, right...?
Back to top View user's profile Send private message ICQ Number
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Fri Aug 17, 2007 4:11 pm    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website
puertoblack2003
-


Joined: 08 Oct 2006
Posts: 87

PostPosted: Fri Aug 17, 2007 9:53 pm    Post subject: Reply with quote

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 View user's profile Send private message
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Sat Aug 18, 2007 2:29 am    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Sat Aug 18, 2007 2:38 am    Post subject: Reply with quote

Here are some good links for you:
http://stephen.calvarybucyrus.org/search/apache+mod_rewrite+tutorial
http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html
http://www.sitepoint.com/article/guide-url-rewriting
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
puertoblack2003
-


Joined: 08 Oct 2006
Posts: 87

PostPosted: Sat Aug 18, 2007 1:41 pm    Post subject: Reply with quote

pkSML wrote:
Here are some good links for you:
http://stephen.calvarybucyrus.org/search/apache+mod_rewrite+tutorial
http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html
http://www.sitepoint.com/article/guide-url-rewriting


you've been a great help thanks...time to study :)
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Mon Aug 20, 2007 12:07 am    Post subject: Re: Understanding Mod-Rewrite Reply with quote

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 View user's profile Send private message Send e-mail
puertoblack2003
-


Joined: 08 Oct 2006
Posts: 87

PostPosted: Wed Aug 22, 2007 8:06 pm    Post subject: Reply with quote

thanks aprelium i thought that had to be added..
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> URL Rewriting All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group