The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 23, 2019, 11:36:54 AM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: mod_rewrite problem...  (Read 4036 times)
LondonSEO
Rookie
**
Offline Offline

Posts: 15


View Profile
« on: September 19, 2007, 02:57:00 AM »

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 [L]

</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 Wink


« Last Edit: September 19, 2007, 09:10:34 AM by perkiset » Logged

No links in signatures please
georgiecasey
Rookie
**
Offline Offline

Posts: 16


View Profile
« Reply #1 on: September 19, 2007, 08:18:32 AM »

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 : \/
Logged

No links in signatures please
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #2 on: September 19, 2007, 09:10:10 AM »

 ROFLMAO

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    ^(.*)$   -    [L]

RewriteCond   %{REQUEST_URI}   /something
RewriteCond   ^(.*)$   /pagegenerator.php?id=$1

Good luck,
/p
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
Tedd
n00b
*
Offline Offline

Posts: 2


View Profile
« Reply #3 on: February 14, 2012, 12:52:05 AM »

Are you sure that this problem can be solved by this way.i was stucked in this same problem an still do not get the perfect solution.
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #4 on: February 14, 2012, 01:41:25 PM »

Since, as a 'bot you are clearly not yet self aware, your inability to solve the problem is unsurprising. We're you to have been written by me you would not have had this issue.

BTW, "Tedd" - as a supposed SEO copywriter (sig removed) you suck  ROFLMAO
« Last Edit: February 14, 2012, 01:42:56 PM by perkiset » Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
Bompa
Administrator
Lifer
*****
Offline Offline

Posts: 564


Where does this show?


View Profile
« Reply #5 on: February 15, 2012, 12:46:25 AM »

Since, as a 'bot you are clearly not yet self aware, your inability to solve the problem is unsurprising. We're you to have been written by me you would not have had this issue.

BTW, "Tedd" - as a supposed SEO copywriter (sig removed) you suck  ROFLMAO

talking to bots again perk?

maybe take a little time off.

Logged

"The most beautiful and profound emotion we can experience is the sensation of the mystical..." - Albert Einstein
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #6 on: February 15, 2012, 07:52:35 AM »

 ROFLMAO
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!