Need help with setting up the url rewrite

New to mod_rewrite? This is a good place to start.

I sent a reply

Postby revo » Tue Jun 30, 2009 6:42 pm

I have not received the email. I have sent a reply email though so you have my email.

thanks
revo
 
Posts: 34
Joined: Fri Feb 13, 2009 2:02 pm

Postby richardk » Wed Jul 01, 2009 8:38 am

http://pastebin.com/m39042cf1 (As far as i can see, it's just the default WAMP/Apache configuration with mod_rewrite enabled.)
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

no email

Postby revo » Wed Jul 01, 2009 8:42 am

for some reason our emails are not being sent to each other. I have your email as uv7t813g AT googlemail.com
Last edited by revo on Wed Jul 01, 2009 9:52 am, edited 1 time in total.
revo
 
Posts: 34
Joined: Fri Feb 13, 2009 2:02 pm

Postby richardk » Wed Jul 01, 2009 8:54 am

I have received 3 emails from you. The latest httpd.conf file is on pastebin here: http://pastebin.com/m39042cf1.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

ok

Postby revo » Wed Jul 01, 2009 10:05 am

Ok I do see it now, but my page is in basic text, I think it left the css behind or something, all the stuff on the page is left aligned and in basic text, no pictures.

I was also reading your post on page 3,

Mod_rewrite doesn't change the links that are outputted by the script, it works on the incoming requests only. You must edit the script to output the new URLs.


how would I edit the script to show the output with the new urls?

ps. thanks for changing the links :)
revo
 
Posts: 34
Joined: Fri Feb 13, 2009 2:02 pm

Postby richardk » Fri Jul 03, 2009 8:58 am

Ok I do see it now, but my page is in basic text, I think it left the css behind or something, all the stuff on the page is left aligned and in basic text, no pictures.

Do you have relative links? FAQ: Relative paths to images, JavaScript, CSS and other external/linked files are broken. Add a <base> HMTL element.

I was also reading your post on page 3,
Mod_rewrite doesn't change the links that are outputted by the script, it works on the incoming requests only. You must edit the script to output the new URLs.

how would I edit the script to show the output with the new urls?

You have to look at the PHP and find where the links are outputted, for example
Code: Select all
echo '<a href="merch.php?merchant=' . $merchant . '">';

Then you need to change it to output the new links, for example
Code: Select all
echo '<a href="/mylocalsite/merch/merchant/' . $merchant . '/">';
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

base

Postby revo » Sat Jul 04, 2009 9:58 pm

I changed the <a to <base and it didn't fix the the page, but I have all my stuff the standard way with the relative path I guess. Is there a quick way in DW cs3 that you know of?
revo
 
Posts: 34
Joined: Fri Feb 13, 2009 2:02 pm

Postby richardk » Mon Jul 06, 2009 12:03 pm

I changed the <a to <base and it didn't fix the the page

I don't think you did it right. You have to add
Code: Select all
<base href="http://www.example.com/">

into the <head> of your pages where http://www.example.com/ is the path the files are relative to.

Is there a quick way in DW cs3 that you know of?

Does it support regular expression search and replace?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby revo » Mon Jul 06, 2009 8:19 pm

There is nothing between the <head> and </head> that says the website url in it. The only things there are javascripts, meta tags, and css styles.

In DW there is a find and replace I can use. What I tried earlier was to go to each link within the page and add <base instead of <a before the link which didn't work. But like I was saying I couldn't find anything between the head tags that say the homepage url in it or even localhost.

Are you saying to put it on anything in the css that have images?
revo
 
Posts: 34
Joined: Fri Feb 13, 2009 2:02 pm

Postby richardk » Tue Jul 07, 2009 8:40 am

There is nothing between the <head> and </head> that says the website url in it.

Right, because you are supposed to ADD it.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

PreviousNext

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 40 guests

cron