1

I am trying to create .htaccess file inside wamp/www/myDirectory. But i am not able to create, it says 'you must type file name'

I have enabled the mod-rewrite also. Now i want to check URL hiding,but i am not able to create .htaccess.

I have created .htaccess file and written code like this

# Avoid redirect loop
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule ^ - [L]

# Add trailing slash
RewriteCond %{REQUEST_URI} !(\.|/$)
RewriteRule (.*) http://%{HTTP_HOST}/$1/ [R=302,L]

RewriteRule ^purchase(.*)$ $1 [R=302,L]

RewriteCond %{REQUEST_URI} !^/purchase/
RewriteRule ^(.*)/$ purchase/$1 [L,QSA]

How can i do this. Please suggest

user2823107
  • 99
  • 2
  • 12
  • possible duplicate of [How to manually create a file with a . dot prefix in windows for example .htaccess](http://stackoverflow.com/questions/5004633/how-to-manually-create-a-file-with-a-dot-prefix-in-windows-for-example-htacce) – Peter Sep 13 '14 at 20:12

2 Answers2

2

Have you tried creating the file via Notepad?

Please see this answer: https://stackoverflow.com/a/5004695/460053

Community
  • 1
  • 1
Peter
  • 2,654
  • 2
  • 33
  • 44
  • Thanks Peter. It worked for me. Can you please suggest me is my above code is write or not? basically i am trying to hide purchase folder name from url – user2823107 Sep 13 '14 at 20:30
  • I no longer use apache, so am unable to verify your code. Give it a try, and see what happens? – Peter Sep 13 '14 at 20:36
-1

In windows, just go to the folder using cmd and type the following command DIR>.htaccess.

This command will create a .htaccess file and will dump some data in it.

Eugine Joseph
  • 1,552
  • 3
  • 18
  • 40