Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

.htaccess rewrite condition

4:02 pm on Nov 21, 2006 (gmt 0)

New User

10+ Year Member

joined:June 29, 2006
votes: 0

Hi There;

I am working on a vbulletin forum addon , which is causing me problems. My forum is located in a subfolder, but the rewrite rule is for the root (I assume). I have only little understanding of rewrite rules. Can somebody tell me how I change the rewrite condition below, so that it will work in my subfolder /forum?

# SEO Videos
# [vbulletin.org...]

# ofcourse you can rename videos.html and make it for example a non existing directory /videos/ and /videos/videoindex-20.xhtml etc.

RewriteCond %{HTTP_HOST}!^www\.domain\.com
RewriteRule (.*) [domain.com...] [L,R=301]

RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule ^videos\.html&page=([0-9]+)$ [domain.com...] [L,R=301]

RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule ^videos\.html$ index.php?videos=1 [L]

RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule ^videos-page([0-9]+)\.html$ index.php?videos=$1 [L]

3:12 pm on Nov 30, 2006 (gmt 0)

New User

10+ Year Member

joined:Nov 29, 2004
posts: 36
votes: 0

To me at least it really isn't clear what you are trying to accomplish. could you be a tad more explicit with your question please. It could be the reason why nobody has replied yet.


5:27 pm on Nov 30, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 9, 2005
votes: 0

If you are trying to go to www.example.com/some-dir/forum you can add some-folder to each side of the rule:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^some-dir/videos-page([0-9]+)\.html$ /some-dir/index.php?videos=$1 [L]

Hope this helps.


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members