user2823107
user2823107

Reputation: 99

creating htaccess file in wamp server

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

Upvotes: 1

Views: 8942

Answers (2)

Eugine Joseph
Eugine Joseph

Reputation: 1558

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.

Upvotes: -1

Peter
Peter

Reputation: 2802

Have you tried creating the file via Notepad?

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

Upvotes: 2

Related Questions