London

SEO

 

Hi Guys,

I'm writing a page generation script based in mysql and

php

 , I managed to did a lot but I still have problems if I'm trying to create more let's call it subdirectories based in the database tables. This is what I have and works well:

# BEGIN

<IfModule mod_rewrite.c>
RewriteEngine on
# Change following path
RewriteBase /something/
RewriteRule ^([A-Za-z0-9-]+)/?$ pagegenerated.

php

 ?id=$1 <>

</IfModule>

# END

everything looks good even the rewriting in a

seo

  friendly way:

www dot mysite dot com/something/page-a-about-something

my problem start when I add another links in that pagegenerated.

php

  page and I want to display something like this:

www dot mysite dot com/something/page-a-about-something/page-b-about-that-last-page

any idea how can I fix this?

Thank you

J.

PS: Someone from syndk8 adviced me to post here Applause


georgiecasey

Your

regex

  doesn't match forward slashes so it wouldnt work on the page-a-about-something/page-b-about-that-last-page
Escape a forward slash in your character class : /

perkiset

Applause

You'd think I'd check my own forum before Syndk8... I posted the following answer over there as well London...

GC - I don't believe you must escape the / in mod_rewrite... I've actually never done nor have I had any difficulties - am I missing something ?


================================================
Syndk8 Post
================================================
Do you mean that you *dont* want it to rewrite if there is a sub/sub dir? perhaps something like this in front (caveat, it's early and I haven't tested this...

RewriteCond  %{REQUEST_URI}  /something/[A-Za-z0-9]+ 
RewriteRule    ^(.*)$  -    <>

RewriteCond  %{REQUEST_URI}  /something
RewriteCond  ^(.*)$  /pagegenerator.

php

 ?id=$1

Good luck,
/p


Perkiset's Place Home   Politics @ Perkiset's