Jump to content

htaccess - how could I remove a folder in the path?


milanello72

Recommended Posts

Hello!

I have 2 problems with .htaccess .

1) I have a path

http://www.myaccount.domain.com/katarina/index.php

and I want to remove the folder katarina and to obtain

http://www.myaccount.domain.com/index.php

How could I solve this problem?

 

2) I have a path on localhost

http://127.0.0.1:8888/katarina/index.php

and I want to remove the folder katarina and to obtain

http://127.0.0.1:8888/index.php

(soI want to remove my folder "katarina")

How could I solve this problem?

 

Thank you!

Hello, Requinix!  :)

I have tried, but didn't work.

In this moment you could see the link here

 

http://www.katarinabulatovic.uhostall.com/32katarina/index.php

And I want to obtain

 

http://www.katarinabulatovic.uhostall.com/index.php

so without 32katarina.

 

I have all files in the folder 32katarina and .httaccess is

 

Options +FollowSymlinks

RewriteEngine on

php_flag session.auto_start 1

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d


RewriteRule ^index.html index.php [N]


RewriteRule ^([a-zA-Z0-9-_]+).html$ index.php?pagina=$1 [L,QSA]

RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9-.\s]+).html$ index.php?pagina=$1&poll=$2 [L,QSA]

RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9-.\s]+)/([0-9-_]+)$ index.php?pagina=$1&paginaphoto=$2&id_photo=$3 [L,QSA]

AddType image/x-icon .ico
RewriteRule ^favicon.ico favicon.ico [NC,L]

ErrorDocument 404 /errors/404
ErrorDocument 403 /errors/403
ErrorDocument 500 /errors/500

 

What can I add in .htaccess ? Thank you!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.