Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

rewrite: / causing problems

Posted on 2006-11-17
3
Medium Priority
?
184 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 2000 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

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

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

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
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 …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

722 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