Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- Url redirection by mod rewrite


Spiekerooger - 11:26 am on Sep 19, 2010 (gmt 0)


Hi Fahad,

if I understand your concern right, you have the following:

A clean virtual URL without a query string that is pointing internally thru mod_rewrite to index.php?var1=x&var2=y.....

Now you want this page only to be accessed by the clean virtual URL, not the index.php with the query string.

First of all, it's the job of your cms to point to the URL you want to have displayed (the clean virtual URL) and it's mod_rewrites job to present the content of the original file once the clean virtual URL is accessed.

But if you do have old backlinks pointing to the real URL or those real URLs are indexed by Search Engines, you could do the following:


#Redirect external requests at real url to virtual url
RewriteCond %{THE_REQUEST} ^real_url$
RewriteRule ^(.*)$ http://www.example.com/virtual_url [R=301,L]
#Grabbing content from real_url while keeping virtual_url displayed
#in the browser
RewriteRule ^virtual_url$ /real_url [L]


If these instructions won't help, please provide us with an exact answer to jdMorgans questions so we can understand what you are up to.

Chris


Thread source:: http://www.webmasterworld.com/apache/4203636.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com