View Full Version : htaccess help?

07-25-2008, 06:22 PM
I have a site and i want to change its links, its a complicated script in php oop.

i want to change a link like




whats the rewrite rule for this?

also theres a pregreplace for the url function

$sUrl = preg_replace('old url', 'new url', $sUrl);

i don't know how to set this up

07-25-2008, 06:26 PM
Frankly I'm not 100% sure where you are asking for PHP.

I recommend you thumb through this for mod_rewrite, http://www.easymodrewrite.com/. It's a great tutorial.

Let us know if you've got another rewrite questions past that.

For PHP, are you trying to get the links to change in your code to match your rewrite rule? Are you doing a global boolen on $rewrite_on = TRUE; for example?

07-26-2008, 02:41 PM
You could do that straight in your .htaccess file. No need for php.

RewriteEngine On
RewriteRule ^gallery/main/?$ http://url.tld/photo