Solved

rewrite: / causing problems

Posted on 2006-11-17
3
167 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

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…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now