Solomon Closson
Solomon Closson

Reputation: 6217

Rewrite Rule change URL

Ok, I need all board urls changed from this:

http://dream-portal.net/board_65.0/

to this:

http://dream-portal.net/board_65/

Basically, I need to get rid of the .0 at the end of the URL, just before the last / character.

How can I do this via .htaccess?

Currently using this in my .htaccess file:

RewriteEngine on
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Upvotes: 1

Views: 478

Answers (1)

Gerben
Gerben

Reputation: 16825

RewriteEngine on
RewriteBase /

RewriteRule ^(board_[0-9]+)\.0/$ $1 [L,R=302]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Upvotes: 1

Related Questions