Solved

rewrite: / causing problems

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

632 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