This is my htacces file content. Its not working. Please help me guys...
DirectoryIndex index.php
Options -Indexes
RewriteEngine on
RewriteBase /shop/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1 [L,QSA]
RewriteRule ^jeans-shirt/?$ /index.php?index/indexproducts/jeans-shirt/c695b64e4b38d8004f7c9b970ecbd104 [QSA,NC,L]
ErrorDocument 404 404.html
try this:
<IfModule mod_rewrite.c>
RewriteEngine On
</IfModule>
Related
I have written the URL Rewriting code in .htaccess file. I want to redirect from /CodecanyonSocial/settings.php to /CodecanyonSocial/index.php?a=profile&u=username
So I have done the code for rewriting. but it is not working. Here CodecanyonSocial is base(main) folder(site is in CodecanyonSocial folder).
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^CodecanyonSocial/index.php?a=profile&u=([A-Za-z0-9-]+)/?$ CodecanyonSocial/settings.php [QSA,L]
</IfModule>
Just try this...
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /CodecanyonSocial/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^CodecanyonSocial/index.php?a=profile&u=([A-Za-z0-9-]+)/?$ CodecanyonSocial/settings.php [QSA,L]
</IfModule>
I am making application in codeigniter and now uploading to GoDaddy server but getting 404 error.
My code is like this
$config['index_page'] = "index.php?";
$config['uri_protocol'] = "QUERY_STRING";
.htaccess file is
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?$1 [L]
I am getting value like
http://yourdomain.com/index.php?controller/action/etc
But i need
http://yourdomain.com/controller/action/etc
Please help.
try this
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>
Try
$config['index_page'] = "";
$config['uri_protocol'] = "AUTO";
Try this... it should work.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /sgu_portal
RewriteCond $1 ^(application|system|private|logs)
RewriteRule ^(.*)$ index.php/access_denied/$1 [PT,L]
RewriteCond $1 ^(index\.php|css|js|images|img|less|player-skin|robots\.txt|opensearch\.xml|favicon\.ico|assets|forums)
input your folder CSS,js,images or else. If not your css not working.
RewriteRule ^(.*)$ - [PT,L]
RewriteRule ^(.*)$ index.php/$1 [PT,L]
</IfModule>
and in CI Config
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
refer this answer
https://stackoverflow.com/a/16558169/1182195
make sure that your server configuration is set to
1 . Enabled mod rewrite
2 . Allow overriding htaccess in your apache
Thank you all for answer Thank you so much but correct answer is like this
code of htaccess file is like this
Options -Indexes
Options +FollowSymLinks
Options -MultiViews
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [NC,L,QSA]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 index.php
</IfModule>
I want to redirect all sub directories under sub directory root/windows/ to root/windows/ct.php
File structure of site is like
root/windows/ct.php
Redirect these type of url
http://www.site.com/windows/games/ or http://www.site.com/windows/games
http://www.site.com/windows/software/ or http://www.site.com/windows/software
To
http://www.site.com/windows/ct.php?ct=games
http://www.site.com/windows/ct.php?ct=software
I am trying like this but it redirects all url to sub directory root/windows/ct.php
RewriteRule ^([^/]*)/ /Site/windows/?ct=$1 [L]
RewriteRule ^([^/windows]*)/ /Site/windows/?ct=$1 [L] // this one shows internal server error
Complete .htaccess code
Options +FollowSymlinks
RewriteEngine on
<IfModule mod_rewrite.c>
RewriteRule ^(error) - [L]
RewriteRule ^[^/]*/[^/]*/(.*\.html) /Site/error/400/ [L]
RewriteRule ^([^/]*)/(.*\.html) /Site/software/?link=$1&id=$2 [L]
RewriteRule ^([^/]*)/ /Site/windows/?ct=$1 [L]
RewriteRule ^sitemap\.xml$ sitemap.php [L]
RewriteRule ^rss/(.*?)\.xml$ rss/$1.php [L]
</IfModule>
ErrorDocument 400 /Site/error/400/
I do not know well about .htaccess please see and suggest any possible way to do it.
Thanks.
Give this a try:
<IfModule mod_rewrite.c>
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^windows/([^/]+)/?$ /windows/ct.php?ct=$1 [L]
</IfModule>
For your localhost use this one:
<IfModule mod_rewrite.c>
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /Site/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^windows/([^/]+)/?$ windows/ct.php?ct=$1 [NC,L]
</IfModule>
I'm newbie with htacces..
I've file htaccess like this
Options -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
I called url like this without index.php it's work
http://localhost/url/
but when I try to call
http://localhost/url/controller/
and
http://localhost/url/controller/method/
the page back to xampp's home.
so what would I do? I want url without index.php.
thank you very much every advice.
Looks like you need something simple like:
RewriteEngine on
RewriteCond $1 !^(index\.php|assets|media|favicon\.ico|ipadicon\.jpg)
RewriteRule ^(.*)$ /index.php/$1
I tried the below code for redirect any page to index page in localhost but somehow it is not working.
<IfModule mod_rewrite.c>
Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [L]
</IfModule>
Please help me to redirect to my site index page.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
IndexIgnore *
</IfModule>
Please make sure mod_rewrite module active in your httpd.conf file like:
LoadModule rewrite_module modules/mod_rewrite.so