473,804 Members | 3,716 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

URL rewriting question

realin
254 Contributor
hi guys,

i want to use URL writing now, cause the other weird characters give a bad impression to the search engines and feeds.

can you tell me what is the code to be written in .htaccess.. is it the same we do in regular expression.. my URL is like

http://domain.com/view.php?action =read&id=8

My .htacccess has already few lines, may be my cpanel write it when i was managing index or the wordpress blog did it when i used the customized URL in it..

.htaccess look something like this ..
Expand|Select|Wrap|Line Numbers
  1. RewriteEngine on
  2.  
  3. <Limit GET POST>
  4. order deny,allow
  5. deny from all
  6. allow from all
  7. </Limit>
  8. <Limit PUT DELETE>
  9. order deny,allow
  10. deny from all
  11. </Limit>
  12. Options All
  13. AuthName domain.com
  14. IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
  15.  
  16. RewriteCond %{HTTP_REFERER} !^http://blog.domain2/.*$      [NC]
  17. RewriteCond %{HTTP_REFERER} !^http://blog.domain2$      [NC]
  18. RewriteCond %{HTTP_REFERER} !^http://domain.com/.*$      [NC]
  19. RewriteCond %{HTTP_REFERER} !^http://domain.com$      [NC]
  20. RewriteCond %{HTTP_REFERER} !^http://domain.com/.*$      [NC]
  21. RewriteCond %{HTTP_REFERER} !^http://domain.com$      [NC]
  22. RewriteCond %{HTTP_REFERER} !^http://www.blog.domain2/.*$      [NC]
  23. RewriteCond %{HTTP_REFERER} !^http://www.blog.domain2$      [NC]
  24. RewriteCond %{HTTP_REFERER} !^http://www.realin.domain.com/.*$      [NC]
  25. RewriteCond %{HTTP_REFERER} !^http://www.realin.domain.com$      [NC]
  26. RewriteCond %{HTTP_REFERER} !^http://www.domain.com/.*$      [NC]
  27. RewriteCond %{HTTP_REFERER} !^http://www.domain.com$      [NC]
  28. RewriteCond %{HTTP_REFERER} !^http://domain2/.*$      [NC]
  29. RewriteCond %{HTTP_REFERER} !^http://domain2$      [NC]
  30. RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
  31.  
  32.  
  33.  
thanks for ur help :)
Oct 22 '07 #1
2 2119
tj111
12 New Member
What you have now is just to prevent hotlinking to pictures hosted on your site. How do you want the URL to look after rewriting?
Oct 29 '07 #2
udaypawar
29 New Member
I am too finding answer to my questions and its getting urgent for me.

I have one URL hosting.idealso lutions.in/domain.php When user points to link http://idealsolutions.in/domain_registration.htm he should be displayed the page from hosting.idealso lutions.in/domain.php link but http://idealsolutions.in/domain_registration.htm should be displayed in address bar. I have very less knowledge of apache. I have read some articles but couldn't understand exactly how can i do that.

Is that possible?
Nov 11 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1899
by: Ricky Romaya | last post by:
Can I have somekind of URL rewriting mechanism without touching the web server's configuration (implemented in pure PHP) and win32 compatible? All the info I have teaches about apache's mod_rewrite or other methods which includes httpd.conf/htaccess editing. Assume I don't have any access to both files.
6
8657
by: Jon Maz | last post by:
Hi All, I am experimenting with URL Rewriting using the techniques outlined by Scott Mitchell in his article "URL Rewriting in ASP.NET" (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/htm l/urlrewriting.asp). In the article he mentions a problem with postbacks: "If the URLs you are rewriting contain a server-side Web Form and perform postbacks, when the form posts back, the underlying URL will be used". His...
3
3272
by: Jamie Jackson | last post by:
I'm rewriting all links' onclick events, but I'm having a problem. The onclick event that I'm inserting works correctly in Opera, but not in FF or IE. I'm retroactively adding the statement "return promptBeforeOpening();" FF and IE rewrite it as I would expect them to, but it turns out that that doesn't work (no disclaimer pops up, and the link is not disabled):
2
2603
by: Jon Maz | last post by:
Hi All, I've been looking into options for URL Rewriting in .net, and to be honest, I haven't seen anything that's easier than the old Classic Asp solution with an ISAPI filter redirecting to an .asp page with responsibility for handling the redirect. I'm now planning to use this solution with my next .net project, and was wondering if anyone else out there has done this already, and what problems (if any) arise. Hopefully the news...
0
2131
by: Lee | last post by:
Hi all ;) Preamble -------- I'm using URL rewriting to enforce a frames policy (yeah, I know frames are 'bad' :) - i.e. if a request comes in for a page which should be nested within a frameset, the url is rewritten to something of the form 'http://www.blah.com/framesdoc.aspx?lowerFrame=/page.aspx', the 'framesdoc' page then dynamically generates the src attribute for the
2
1291
by: KMA | last post by:
My site has dynamicaly generated pages. Most of the URLs are false, and I used to trap them in a generic 404 page, which stripped off a unique part of the URL, built the page then sent that back to the client. But then the address bar always showed the 404 plus the query string which contains the originally requested URL. Apart form that all was well. So to circumvent this I used URL rewriting in Global.asax. Same idea, just look for...
3
4745
by: Greg Collins [Microsoft MVP] | last post by:
I have done a bit of research of Url Rewriting, but as yet have been unsuccessful at getting it to work well, and there are issues around what file types are supported and how much code you want to write. While working on a similar, though partially unrelated, issue, I came across a possible alternate method. Before I pursue this method in full, I wanted to get opinions of others as to any unforseen issues I might encounter. The method is...
1
1704
by: Greg Collins [Microsoft MVP] | last post by:
I have a site that uses a custom 404 error page to perform URL Rewriting. This works excellent for all my needs except for one area. When transforming XML, I have some XSLT code that uses the document() function to load some dynamic XML from a SQL database via an ASP.NET page. I am able to get this to work by calling the rewritten URL via an HTTP call--for example: document('http://site/fakefile.xml"). For a while now I have been trying to...
9
628
by: Frankie | last post by:
I understand that with URL rewriting we can have a request come in for, say Page1.aspx, and rewrite it so that PageA.aspx gets served up to the user. My question (assuming the above is correct): What does the user see in the browser after URL Rewriting? In the above case, when PageA is rendered to the browser, will the address bar show "PageA.aspx" or would it show "Page1.aspx" - the originally requested URL? Thanks.
0
1290
by: Stephan Zahariev | last post by:
Hi all, I'm developing large web site for manufacturing based on web parts. As well the site uses URL rewriting via IHttpModule handler and custom PersonalizationProvider to persist web part data. Everything works fine except when I try to export a web part. I have enabled the export verb for the web parts and when I click on this verb the post back is to the original URL instead of the dynamically rewrited address. I have noticed...
0
9585
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10586
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6856
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5658
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2997
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.