[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Mod Rewrite Problem

Posted on 2006-07-13
21
Medium Priority
?
368 Views
Last Modified: 2010-03-04
does anybody have any idea why mod rewrite would rewrite a url and show up blank page where by the page itself is not blank.

for example: i have pages.php?id=45 to be rewritten as pages/45.

that would go on and show me a blank page, but when i access it as pages.php?id=45 it gives me the normal result

pls help urgently
0
Comment
Question by:xavier45
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 8
  • 2
  • +1
21 Comments
 
LVL 57

Expert Comment

by:giltjr
ID: 17109490
Do you want to post your rewrite rules?
0
 

Author Comment

by:xavier45
ID: 17112863
oh yeah, here it is

RewriteRule ^entry/([0-9]+)$ entry.php?id=$1 [L]
0
 
LVL 57

Expert Comment

by:giltjr
ID: 17112975
try

     RewriteRule pages/(.*)/(.*)$ /pages.php?$1=$2
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:xavier45
ID: 17113015
thanks but i'm still getting the same result
0
 
LVL 57

Expert Comment

by:giltjr
ID: 17113038
O.K, just to make sure if I enter:

    http://yourhostname.yourdomainname.tdl/pages/45

I will see the correct page?
0
 

Author Comment

by:xavier45
ID: 17113052
i'm running this on my local machine

http://localhost/m_box/pages/45
0
 

Author Comment

by:xavier45
ID: 17113058
i.e if i enter http://localhost/m_box/pages/45 in the address bar i get a blank page but if i enter http://localhost/m_box/pages.php?id=45 i get the normal results(as in results related to page 45) not a blank page
0
 
LVL 57

Expert Comment

by:giltjr
ID: 17113101
O.K.  is 45 supposed to be a directory?  Do you have the directory /page/45 and in that directory do you have index.html, or some other default page?

Do you really mean that you want somebody to enter http://localhost/m_box/pages/45 have have it re-written as http://localhost/m_box/pages.php?45


0
 

Author Comment

by:xavier45
ID: 17113112
no its not a directory its just a query to the db(i.e querying the db with id 45)

>>Do you really mean that you want somebody to enter http://localhost/m_box/pages/45 have have it re-written as http://localhost/m_box/pages.php?45

yes but instead of showing the exact page i get a blank page
0
 

Expert Comment

by:sinisterfrog
ID: 17113243
how about

RewriteRule pages/(.*) /pages.php?id=$1

?
0
 
LVL 57

Expert Comment

by:giltjr
ID: 17113291
http://www.webmaster-toolkit.com/mod_rewrite-rewriterule-generator.shtml

It came up with:

     RewriteRule pages/(.*)/(.*)/$ /m_box/pages.php?$1=$2

based on the user entering:

     http://localhost/m_box/pages/45

and you wanting:

     http://localhost/m_box/pages.php?45
0
 

Author Comment

by:xavier45
ID: 17113292
thanks but i'm still getting blank pages
0
 

Assisted Solution

by:sinisterfrog
sinisterfrog earned 90 total points
ID: 17113980
make a new pages.php that echos the $id value.... maybe it's a problem with ur php code...
0
 
LVL 27

Expert Comment

by:caterham_www
ID: 17115877
blank page=completly white? That sounds like the PHP bug.

Does
RewriteRule ^a /b.html [L]

work (rewriting to non-php files)?
0
 

Author Comment

by:xavier45
ID: 17115987
>>make a new pages.php that echos the $id value.... maybe it's a problem with ur php code...
no my code is fine as i said in my question "when i access the page as pages.php?id=45, it woeks fine, as in i get what i expected(results related to 45)"

>>blank page=completly white? That sounds like the PHP bug.
Yes

>>Does
RewriteRule ^a /b.html [L]

work (rewriting to non-php files)?

yes it does
0
 
LVL 57

Expert Comment

by:giltjr
ID: 17116310
If you use your browsers "view source" option, what HTML code shows?

I agree with sinisterfrog, make a new pages.php script but instead of just echoing id, I would echo the whole URL that it is invoked with.  If the rewrite is working, then you can see what it is doing.  However if the rewrite is not working I would expect you to get some error page and not just a blank page.

0
 

Author Comment

by:xavier45
ID: 17116601
>>However if the rewrite is not working I would expect you to get some error page and not just a blank page.

thats what i'm saying if there's a problem i should be getting an error page and not just a blank page
however if i sometimes mess up with the .htaccess syntax(you know just to see if i'd get an error page) i get an error page so i don't think this has to do with an error.

what the problem is, i just don't know
0
 
LVL 57

Expert Comment

by:giltjr
ID: 17117731
Do you see anything in the Apache logs?
0
 
LVL 27

Accepted Solution

by:
caterham_www earned 450 total points
ID: 17117790
0
 

Author Comment

by:xavier45
ID: 17134974
what do you advice that i do now?
0
 
LVL 57

Assisted Solution

by:giltjr
giltjr earned 210 total points
ID: 17135627
It appears that this is fixed in the latest releases of V4 and V5.  Install the most recent levels of what ever version you are running?
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month14 days, 6 hours left to enroll

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question