URL rewriting for whole site

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I need help with something..

Here it is

I am running vbulletin Forums (v4.0.3) on my website and using the
plugin (vbseo v3.5.0) which converts the forums' urls into more search
engine friendly links (SEO).

Now, the new version of vbulletin has already a built-in SEO system
and I want to use this system instead of the vbseo plugin.

The problem is the link format in both systems are different

vbulletin looks somethin like that:
http://www.example.com/forum /[thread-ID]+[thread-name].html

While the vbseo link look like that:
http://www.example.com/forum /[thread-ID].html

Since I have a lot of indexed pages in google, I have to use the
ahaccess to redirect visitors from old links to new links.

Is it possible ? if it is possible, what is the code ?

Thank you,

Re: URL rewriting for whole site

????? wrote:
Quoted text here. Click to load it

Nothing to do with PHP.  Try an Apache newsgroup such as
alt.apache.configuration would be more appropriate.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: URL rewriting for whole site

El 08/06/2010 12:57, حبوبي escribió/wrote:
Quoted text here. Click to load it

You'd basically need to do this:

1.- Tell out whether current URI belongs to old or new format.

You can read the URL from $_SERVER['REQUEST_URI'] and test it against
the old format:

if( $_SERVER['REQUEST_URI'] == '/forum/' . $thread_id . '.html' ){
    // It's old

2. If required, perform a permanent HTTP redirection before anything else:

$url = 'http://www.example.com/forum /' . $thread_id  . '+' .
rawurlencode($thread_name) . '.html';
header('Location: ' . $url, TRUE, 301);

The key point is doing all this without mangling your current
installation. I don't know Vbulletin works; if there's some setting that
allows to execute custom code, it'll be easy. Otherwise, doing it in PHP
will not be worth the effort.

In general, it's easier to do this with Apache's mod_rewrite module (of
course, if you are using Apache).

-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com

Re: URL rewriting for whole site

On Jun 8, 3:57=C2=A0pm,AD=D8=A8=D9=88=D8=A8=D9=8A <h.habbo...@gmail.co=
m> wrote:
Quoted text here. Click to load it

  If you are worried about the cached URLS, then the best way to do
get all the cached links or 404 links from Google and write a redirect
permanent (This is a 301 redirection statement)in  your .htaccess

e.g. RedirectPermanent /forum/[thread-ID]+[thread-name].html
http://www.example.com/forum /[thread-ID].html
     RedirectPermanent /forum/[thread-ID2]+[thread-name2].html
http://www.example.com/forum /[thread-ID2].html

Site Timeline