...

View Full Version : URL rewriting problem..



nissar
01-04-2008, 12:42 PM
Hi dears,

My website need a new page for the URL www.hostname.com#277.
ie, when users visiting this URL, it should see some page other than my home page (index.php)...

I tried URL redirect through htacess with following conditions..but I didn't get a solution for this..

I tried
1. RewriteRule ^#277 /new_page.php

2. RewriteRule ^index.php#277 /new_page.php

but it seems not working this line of code ..

Please anyone can help me.. Also, is there any other solution than URL rewriting to display the new page when visiting www.hostname.com#277 ?

Regards
Nissar

Inigoesdr
01-04-2008, 02:22 PM
You can't use the pound sign(#) in a URL rewrite because it's never sent to the server. It's used by the browser to point to anchors. Most sites use pseudo-directories for their rewrites: url.com/page/id/name etc.

skmd
01-04-2008, 08:30 PM
actually there is another command in .htaccess file wich let you to define the home page
ie,

DirectoryIndex YOURHOMEPAGE.php index.php index.html
note that this applied to all directories under this folder so its better to add another choice if YOURHOMEPAGE.php is not exist, otherwise it will display "Page not found" error (the other choice's here in the example are index.php and index.html)

nissar
01-05-2008, 04:44 AM
actually there is another command in .htaccess file wich let you to define the home page
ie,

DirectoryIndex YOURHOMEPAGE.php index.php index.html
note that this applied to all directories under this folder so its better to add another choice if YOURHOMEPAGE.php is not exist, otherwise it will display "Page not found" error (the other choice's here in the example are index.php and index.html)

Thank you for the help..

But my requirement is slightly different.. I need to display a different page only when the URL is www.hostname.com#277. and when the url is www.hostname.com I should see www.hostname.com/index.php..

Please can you give me a suggestion for this?
Thank you in advance



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum