Forum Moderators: phranque

Message Too Old, No Replies

Wordpress mod rewrite issues

Adding a file extension

         

madmatt69

9:44 pm on Jan 29, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Heya,

Hoping someone can help me out with this.

I'm converting a site to wordpress, but need to keep the file extension of some of the page. For example, "mysite.com/topic/thepage.shtml"

Right now as a test I have this code:


RewriteEngine on
RewriteRule ^uncategorized/hello-world$ topic/thepage.shtml

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

However this doesn't seem to do anything. If I try to edit the 'slug' to 'thepage.shtml' wordpress stips out the '.' leaving me with 'thepageshtml'.

Its really important I keep this particular URL, I can't afford to 301 it to a different url for various reasons.

Any idea on how to do this?

Thanks!

phranque

12:07 am on Jan 30, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



you probably need to escape the dot with a backslash like 'thepage\.shtml'

madmatt69

1:34 am on Jan 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Heya,

Thanks - I just tried that and its still not working..That didn't seem to change anything.

Any other ideas?

jdMorgan

2:07 am on Jan 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nothing you can do in .htaccess is going to change WP handling of URLs. If you cannot get WP to publish you .shtml link, then you'll need another approach.

Jim