
![]() |
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 seofriendly way:www dot mysite dot com/something/page-a-about-something my problem start when I add another links in that pagegenerated. phppage 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 ![]() georgiecasey
Your
regexdoesn't match forward slashes so it wouldnt work on the page-a-about-something/page-b-about-that-last-pageEscape a forward slash in your character class : / perkiset
![]() 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=$1Good luck, /p |

Thread Categories

![]() |
![]() |
Best of The Cache Home |
![]() |
![]() |
Search The Cache |
- Ajax
- Apache & mod_rewrite
- BlackHat SEO & Web Stuff
- C/++/#, Pascal etc.
- Database Stuff
- General & Non-Technical Discussion
- General programming, learning to code
- Javascript Discussions & Code
- Linux Related
- Mac, iPhone & OS-X Stuff
- Miscellaneous
- MS Windows Related
- PERL & Python Related
- PHP: Questions & Discussion
- PHP: Techniques, Classes & Examples
- Regular Expressions
- Uncategorized Threads