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
Solved

rewrite: / causing problems

Posted on 2006-11-17
3
172 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
  • 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

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…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

828 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