htacces mod rewrite help

bagging

Newbie
Joined
Jan 15, 2009
Messages
39
Reaction score
29
Hello ppl,

I have used like 4 hours on google trying to find some sort of code example to rewrtie urls with mod rewrite.

I all seems like voodoo to me! So i hope someone can help me out. I think its pretty simply but i can't wrap my head around this subject.

I need a htacces url rewrite script that will rewrite all urls on my domain to the same url. So all urls after mydomain.com/ would be rewritten to look like myrewrittenurl.html.

Is this possible?

Thanks
 
Thanks for the answer mate...

I know it sounds crazy and it's like totally reverse SEO to make all dynamic urls into one single url. But the idea is to hide all of our dynamic urls from SE and visitors..

Maybe i posted this in the wron forum but i found other htacces realted questions in this one and i know it totally reversed SEO but a good htacces script for hiding all your urls could be used in many ways..

Thanks
 
If you do that, you will never have your site working properly... All pages will be redirected to the same URL...
If this is what you want, something like this should make it :
Code:
RewriteEngine On
Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} ^http://*\.google\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://*\.yahoo\.com [NC,OR]
RewriteRule (.*) /myrewrittenurl.html [L]

You must repeat the conditions for as many SEs as you need.
 
Thanks for the answer mate...

I know it sounds crazy and it's like totally reverse SEO to make all dynamic urls into one single url.

Yes it does sound crazy, but anyhow you must have your reasons.

Well rewrite isn't really going to cut it, you would be better off using a 100% frame and encrypting the frame code.

Code:
http://www.tareeinternet.com/scripts/iframe-encoder/

On that tool put the following in the top box:

Code:
<IFRAME SRC='www.yoursite.com' WIDTH="100%" HEIGHT="100%"></IFRAME>

Just add your URL, is that the end result you want?
 
Thanks for all the great answers..

Maybe i got the rewrite thing all wrong ? I did not know that every link would redirect to the new link. I thought that it only would be rewritten in the browser.

the original idea was that we could have lots of different dynamic urls like

Site.com/kdfkfdo.php
site.com/jfoidsfjods.php

etc. etc.

No matter what page the user loads the url is rewritten into lets say index.html - But the code from the dynamic page is loaded..

Get my drift?

But that iframe encoder was just a amazing link mate! Thanks a million!
 
You still could do that but you would need to use POST requests (ie, form submissions in javascript) which is really not nice, nor bot friendly etc...
The iframe would make it better ;)
 
Back
Top