0

I have forum files located within a folder directory. Right now my urls look like this

http://www.example.com/forum/fx/pagename/

However I am wondering if I can use mod rewrite to rewrite my urls in the following format while keeping the forum files within the forum folder:

http://www.example.com/fx/pagename/

where x equals a number

anubhava
  • 761,203
  • 64
  • 569
  • 643
Mike
  • 235
  • 3
  • 15

2 Answers2

0

Is this what you're looking for?

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^f([0-9]+)/([^/]+) /forum/f$1/$2 [L]
Panama Jack
  • 24,158
  • 10
  • 63
  • 95
0

Have this rule in DocumentRoot (a level above forum) .htaccess:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^((?!forum/).+)$ /forum/$1 [L,NC]
anubhava
  • 761,203
  • 64
  • 569
  • 643