.htaccess file :
# Do not remove this line, otherwise mod_rewrite rules will stop working
RewriteBase /
when i added this line :
Options -Indexes to htaccess file , the site Stopped working
please advice and thanks
Related
I have a website which is working until i have uploaded .htaccess file.
My directory path be like
/MY_PROJECT
And in .htaccess Starting code is
IndexIgnore *
RewriteEngine On
RewriteBase /
i also tried by putting
RewriteBase /MY_PROJECT
but still it shows an Internal Server Error
I have a website with url mydomain.com/about.php?see=help
I want to rewrite it to some simple url.
I rewritten it to be mydomain.com/help.htm using the following code written at my .htaccess file which works perfectly fine.
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*)\.htm$ about.php?see=$1
But I want to use mydomain.com/about/help I'm using the following code to achieve it but it gives error. The page is opening properly but it doesn't include my css file due to which a page without any css styles opens.
Options +FollowSymLinks
RewriteEngine on
RewriteRule about/(.*)/ about.php?see=$1
RewriteRule about/(.*) about.php?see=$1
Please tell me what is wrong.
Note: all files of my website including the CSS file are in same home directory of my website.
Can somebody please tell me the exact code to convert #1 to #2? I'm new to .htaccess and I am having trouble with this.
http://www.domain.com/folder/subfolder1/subfolder2/subfolder3/
http://www.domain.com/folder.php?param1=subfolder1¶m2=subfolder2¶m3=subfolder3
I want the URL in the address bar to keep being #1 so that is what the user sees. Meanwhile, the server treats the URL as page #2 so I can use GET variables in my code.
Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^(folder)/(subfolder1)/subfolder2/subfolder3/?$ /$1.php?param1=$2¶m2=$3¶m3=$4 [L,QSA,NC]
I am trying to figure out how to get my .htaccess to redirect just the homepage URL to a sub directory (domain.com > domain.com/sub/sub ), but I still want the URL to display as domain.com.
I looked around for the past hour and have tried a number of suggestions that I found but nothing worked out.
Any Ideas?
Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^$ /sub/sub [L]
I am trying to redirect any and all requests to a certain directory, even if the requests include arguments. For instance, I see that Google is listing a couple old links from an old blog as 404, but the links look like: example.com/stuff/?args .. So I feel like I need to redirect any request that goes to /stuff/ and also strip the args since they will produce their own 404's if they are left on.
Any help would be greatly appreciated.
Thanks.
Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^stuff/?$ new-dir? [L,R,NC]
Or using mod_alias:
RedirectMatch ^/stuff/?.* /new/?