Jump to content

Help rewriting this page?


Perad

Recommended Posts

I am redeveloping a site and the client wants to keep the link structure. The link structure is bad and I am strugling to rewrite it.

 

If someone could help me with this first one I should be able to rewrite the rest of them.

 

This is the URL.

 

http://localhost/iraqidinars/iraqidinars/newiraqidinars.html

 

I need the server to redirect requests for this file to...

 

http://localhost/iraqidinars/index.php?page/1

 

I tried adding this line

 

RewriteRule ^iraqidinars/newiraqidinars\.html$ iraqidinars/index.php?site/show/1

 

However this generates an error. Does anyone have any ideas on how to solve this?

Link to comment
Share on other sites

To be honest, the url should be like this.

 

sitename.com/pagename/

 

However, I have been told that I must, MUST keep existing url's. I have no choice on this matter, this is despite my best arguing.

 

All I want to do is this.

 

When someone goes to this page.

 

http://localhost/iraqidinars/iraqidinars/newiraqidinars.html

 

The URL should show the above. However the server needs to show this page.

 

http://localhost/iraqidinars/index.php?page/1

 

I thought that this was what mod_rewrite was for.

 

To make sitename.com/page into sitename.com/index.php?page=...

 

All I want to do is make a php page display when a html page is called. I hope that makes sense.

Link to comment
Share on other sites

I'm sure you will be doing it with a quite a few URLs do try something like this..

 

RewriteRule ^/([a-zA-Z]+)/([a-zA-Z]+)\.html$ /index.php?site=$1&page=$2 [L]

 

I'm not very good with regular expressions but if it works as i think it will then you could have something like;

 

iraqidinars/newiraqidinars.html

 

and it would go to;

 

index.php?site=iraqidinars&page=newiraqidinars

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.