Forum Moderators: phranque

Message Too Old, No Replies

ReWrite If First Directory is Numeric: For Pagination ReWrite

Want a rewrite rule for cases where first directory is numeric

         

geckofuel

3:12 pm on Aug 22, 2007 (gmt 0)

10+ Year Member



Here's the code.

RewriteEngine On
RewriteRule ^mywebsite.com/([0-9]+)$ /index.php?page=$1 [L,NS]

Basically, I just want to rewrite URLs of this type:

[mywebsite.com...]

to URLs of this type;

[mywebsite.com...]

Any thoughts?

geckofuel

5:23 pm on Aug 22, 2007 (gmt 0)

10+ Year Member



Ah, this should be so simple but it's driving me crazy. What am I overlooking?

g1smd

6:51 pm on Aug 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The part of the RewriteRule that tests the requested URL should only include the filepath, NOT the domain.

The thread at: [webmasterworld.com...] will get you started.

There are several other canonicalisation issues to also take into account here.