Solved

rewrite: / causing problems

Posted on 2006-11-17
3
176 Views
Last Modified: 2010-03-04
Hello,

I put this is my .htaccess file:
            RewriteEngine on
            RewriteRule sitemap.html.* index.php?function=sitemap [L]
            RewriteRule ^edit?$ admin
            RewriteCond $1 !=admin/
            RewriteRule ^([^.]+)$ index.php?page=$1 [L]

The problem is that if someone uses this for a URL:
            foo/bar/zoo

They are taken to
            index.php?page=foo/bar/zoo

But all images are broken because it is looking for the images in a directory that does NOT exsist (foo/bar/zoo)



AND if someone uses this for a URL:
            sitemap.html/

they are taken to index.php?function=sitemap (which is correct) but ALL images are broken.

How can solve this?

Ideally
            foo/bar/zoo
would become
            foo_bar_zoo

and
            sitemap.html/

would become
            sitemap.html_
0
Comment
Question by:hankknight
[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
  • 2
3 Comments
 
LVL 43

Accepted Solution

by:
ravenpl earned 500 total points
ID: 17964953
Why will not You use php to translate the $_GET['page'] variable inside the script?
$_GET['page'] = strtr($_GET['page'], '/', '_');
Refer http://pl2.php.net/manual/en/function.strtr.php
0
 
LVL 16

Author Comment

by:hankknight
ID: 17975753
That is not what I was asking for but it is a good idea which I will use.

Thank you very much.

I have posted a related question here:
http://www.experts-exchange.com/Web/Web_Servers/Apache/Q_22064358.html
0
 
LVL 16

Author Comment

by:hankknight
ID: 17975756
Sorry, the above link was wrong.

I have posted a related question here:
http://www.experts-exchange.com/Web/Web_Servers/Apache/Q_22066095.html
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

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…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

752 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