Questions tagged as 'htaccess'

2
answers

Multiple Access-Control-Allow-Origin Domains

I have a page that serves some data in JSON format based on the data received from the database, but I need to release access so that the mobile version can also get such data, how can I put more than one domain in Access-Control- Origin of htac...
asked by 02.02.2017 / 14:07
1
answer

Force 'www' and https in url - HTACCESS [closed]

Below is the code to force www and https in the url of the page using htaccess, who needs it, for me it worked right. Hugs RewriteEngine On RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} !^www\.site\.com\.br$ [NC] RewriteRule ^(.*)$...
asked by 15.02.2017 / 23:46
2
answers

hide variable in url with htaccess

I wonder if there is any way to hide a subdirectory or a variable in the friendly url? Example: .htaccess RewriteRule ^([a-z,0-9,A-Z,_-]+)/categoria-([a-z,0-9,A-Z,_-]+)$ index.php?link=6&categoriaid=$1 In this case, I pass the catego...
asked by 08.11.2016 / 20:22
3
answers

Use or not to use a slash at the end of a URL?

Whenever I'm going to create a new website and think about .htaccess , I hit that doubt: force or not force the use of the slash at the end of the URL. For example: link would be 301-redirected to link . By doing this redirection,...
asked by 29.01.2014 / 20:39
4
answers

How to get the last segment of the path?

URLs de exemplo: content/edit content/edit/ content/edit?q= content/edit/?q= I tried to make the code but it always fails when the url does not have "/" or "?" and if you have "/?" in the end. The code I made was: .*\/([a-zA-Z0-9]*)[\/\?].*...
asked by 18.09.2017 / 16:25
1
answer

What does this htaccess regex do?

I have this regex: RewriteRule ^www\/login\/?$ login/ [L,NC,R] What does it do?     
asked by 13.07.2017 / 22:51
1
answer

Release access to page 404.html with .htaccess

I'm having a problem while trying to free access to page 404.html through my .htaccess, I always give Internal Server Error. How do I enforce a rule for only 404.html to be released for direct access? .htaccess: Options -Indexes RewriteEngi...
asked by 19.02.2014 / 19:03
3
answers

Block access to pages containing ".php" with HTACCESS

I want to block direct access to files ending with the .php extension. Let's say I have a page called teste.php . If the user tries to access it by teste.php it will receive a 404. The only way the page can be accessed wou...
asked by 04.06.2015 / 19:02
1
answer

How can I change the URL of my home page in Wordpress?

I have a website in WordPress, when accessing it it gets dominio.com , but I want only the index of it to change to www.dominio.com/home . That is, when accessing www.dominio.com , change to www.dominio.com/home...
asked by 07.04.2018 / 22:50
1
answer

Module rewrite in .htaccess for sub folders

I have an application in AngularJs with html5 enabled, which causes me to use apache rewrite module for the correct conversion of the URL. I have no problem to use this when accessing the application with the index from t...
asked by 14.04.2016 / 14:59