Forum Moderators: phranque

Message Too Old, No Replies

Redirecting Dynamic Page to static page.

Redirecting Dynamic Page to static page. with manually creating static page

         

neoonprowl

9:03 am on Aug 27, 2007 (gmt 0)

10+ Year Member



Hello,

I am having a website where i am having dynamic URL pages in with .php extension.

eg:http://www.mydomain.com/subcategory.php?subcatID=5&subname=nokia-n70

i can have redirection code on. .htacces file like

Options +FollowSymLinks
RewriteEngine on

RewriteRule ^category/([0-9]+)]+)/([0-9A-Za-z]+).html$ subcategory.php?subcatID=$1&subname=$2 [L]

and on php page i having have code that create dynamic pages to static pages.

echo "<a href='http://www.".$DOMAIN_NAME."/category/".$rw_sub[0]."/".
format_str(stripslashes($rw_sub[1])).".html'>".$rw_sub[1]."</A></DIV>";

it is creating my dynamic links to static links.
[mydomain.com...]

but when i click on that link i didn't find that pages there because i am not having that static html page on that specific static location.

i just wanna know is it possible to have that static pages there without creating them manually.

like if i have dynamic page as :
[mydomain.com...]

and it became static as :
[mydomain.com...]

but can i have this static page there without make it manually on that location.

Please suggest.

Thanks

neoonprowl

8:52 pm on Aug 27, 2007 (gmt 0)

10+ Year Member




My problem is that i am having .haccess and php code make my menu link static from

[mydomain.com...]

to

[mydomain.com...]

But when i click on these static link then its show me a blank page with " Page Cannot be found" error.
because i am not having that static html page on that specific static location.

It is nessecry to create that page nokia-n70.html manually there at specific location "http://www.mydomain.com/category/5/"

Or it can be happen automaticlly
please suggest

jdMorgan

10:49 pm on Aug 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, it is not necessary to have a file with the same name as the 'static' URL.

The RewriteRule you posted should rewrite requests for the static URL to your subcategory.map script. Your code looks OK, and it looks like it should work, as long as it is located in the .htaccess file in the directory above the 'category' directory.

Jim