Welcome Guest, Not a member yet? Register   Sign In
Problem with mod_rewrite
#1

[eluser]Unknown[/eluser]
Hi,

it is my first post so please be nice ;P

I have problem with mod_rewrite i do not know how to use it in right way.

My code:
Code:
RewriteEngine On /
RewriteBase

RewriteRule ^archiwum.html$ index.php/file/nowy [L]

After i made request for example: http://localhost/frame/archiwum.html

CI funnel me to the address http://localhost/index.php/file/nowy and changed it.

Is there any possibility to load the address without changing it in browser ?
#2

[eluser]Molchy[/eluser]
[quote author="Tabb" date="1307397442"]Hi,

it is my first post so please be nice ;P

I have problem with mod_rewrite i do not know how to use it in right way.

My code:
Code:
RewriteEngine On /
RewriteBase

RewriteRule ^archiwum.html$ index.php/file/nowy [L]

After i made request for example: http://localhost/frame/archiwum.html

CI funnel me to the address http://localhost/index.php/file/nowy and changed it.

Is there any possibility to load the address without changing it in browser ?[/quote]

Best way is that u tell us what URL u wanna have or what u wish to do Wink

Normaly CI users remove index.php from URL ... and have something like this:
http://www.url.com/par/par ...

Secondly CI users force WWW to url because of better SEO ...
#3

[eluser]Unknown[/eluser]
I want to have url like this:

http://www.example.com/plik-6330-2hdd.html

To be loaded from:

index.php/file/windows/6330/2hdd

how to to this ?
#4

[eluser]Molchy[/eluser]
[quote author="Tabb" date="1307403201"]I want to have url like this:

http://www.example.com/plik-6330-2hdd.html

To be loaded from:

index.php/file/windows/6330/2hdd

how to to this ?[/quote]

1. In config.php file have this settings:
Code:
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
$config['url_suffix'] = '.html';


2. Make this .htaccess file:
Code:
<IfModule mod_rewrite.c>
     RewriteEngine On
     RewriteBase /

     # Removes access to application folder and its subfolders
     RewriteCond %{REQUEST_URI} ^application.*
     RewriteRule ^(.*)$ /index.php?/$1 [L]

     # Removes access to system folder and its subfolders
     RewriteCond %{REQUEST_URI} ^system.*
     RewriteRule ^(.*)$ /index.php?/$1 [L]

     # Request to index.php if correct access
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
     ErrorDocument 404 /index.php
</IfModule>

Hopefully i didnt forget anything Wink




Theme © iAndrew 2016 - Forum software by © MyBB